@Test public void When_ContainsIgnoreCaseIsCalled_Expect_CorrectResult() { assertThat(containsIgnoreCase("STRING1", "StRiNg1"), is(true)); assertThat(containsIgnoreCase("STRING1", "StRiNg12"), is(false)); }
public static boolean containsIgnoreCase(String str, String searchStr) { if (str != null && searchStr != null) { int len = searchStr.length(); int max = str.length() - len; for (int i = 0; i <= max; ++i) { if (str.regionMatches(true, i, searchStr, 0, len)) { return true; } } return false; } else { return false; } }
StringMethods { public static boolean containsIgnoreCase(String str, String searchStr) { if (str != null && searchStr != null) { int len = searchStr.length(); int max = str.length() - len; for (int i = 0; i <= max; ++i) { if (str.regionMatches(true, i, searchStr, 0, len)) { return true; } } return false; } else { return false; } } }
StringMethods { public static boolean containsIgnoreCase(String str, String searchStr) { if (str != null && searchStr != null) { int len = searchStr.length(); int max = str.length() - len; for (int i = 0; i <= max; ++i) { if (str.regionMatches(true, i, searchStr, 0, len)) { return true; } } return false; } else { return false; } } private  StringMethods(); }
StringMethods { public static boolean containsIgnoreCase(String str, String searchStr) { if (str != null && searchStr != null) { int len = searchStr.length(); int max = str.length() - len; for (int i = 0; i <= max; ++i) { if (str.regionMatches(true, i, searchStr, 0, len)) { return true; } } return false; } else { return false; } } private  StringMethods(); static StringMethods getInstance(); String fixPath(final String path); String checkExtension(final String path); String getNameDB(final String path); static boolean containsIgnoreCase(String str, String searchStr); }
StringMethods { public static boolean containsIgnoreCase(String str, String searchStr) { if (str != null && searchStr != null) { int len = searchStr.length(); int max = str.length() - len; for (int i = 0; i <= max; ++i) { if (str.regionMatches(true, i, searchStr, 0, len)) { return true; } } return false; } else { return false; } } private  StringMethods(); static StringMethods getInstance(); String fixPath(final String path); String checkExtension(final String path); String getNameDB(final String path); static boolean containsIgnoreCase(String str, String searchStr); static final String DEFAULT_FOLDER; }