← Unit 1 · all exercises
Saved in this browser only

Same word, any capitals

Return true when the two words are the same apart from capital letters, so "Java" and "JAVA" both count as matching "java".

boolean sameIgnoringCase(String a, String b)

Solution.java
Loading editor…
Results

Examples

  • sameIgnoringCase(Java, JAVA) → true
  • sameIgnoringCase(java, python) → false

There are also 3 hidden tests you can't see. Solve the problem, not the examples.