indexOf Case Sensitive?
Is the indexOf(String) method case sensitive? If so, is there a case insensitive version of it? The indexOf() methods are all case-sensitive. You can make them (roughly, in a broken way, but working for plenty of cases) case-insensitive by converting your strings to upper/lower case beforehand: s1 = s1.toLowerCase(Locale.US); s2 = s2.toLowerCase(Locale.US); s1.indexOf(s2); Is the indexOf(String) method case sensitive? Yes, it is case sensitive: @Test public void indexOfIsCaseSensitive() { assertTrue("Hello World!".indexOf("Hello") != -1); assertTrue("Hello World!".indexOf("hello") == -1); } If