@Test(dataProvider = "matchesIgnoreCase") public void testMatchesIgnoreCase(String a, String b, int pos, boolean expected) { assert StringUtils.matchesIgnoreCase(a, b, pos) == expected; }
public static boolean matchesIgnoreCase(String a, String b, int posA) { int posB; char cA; char cB; if(posA < (posB = b.length())) return false; while(posB > 0) { if(!Character.isLowerCase(cA = a.charAt(--posA))) cA = Character.toLowerCase(cA); if(!Character.isLowerCase(cB = b.charAt(--posB))) cB = Character.toLowerCase(cB); if(cA != cB) return false; } return true; }
StringUtils { public static boolean matchesIgnoreCase(String a, String b, int posA) { int posB; char cA; char cB; if(posA < (posB = b.length())) return false; while(posB > 0) { if(!Character.isLowerCase(cA = a.charAt(--posA))) cA = Character.toLowerCase(cA); if(!Character.isLowerCase(cB = b.charAt(--posB))) cB = Character.toLowerCase(cB); if(cA != cB) return false; } return true; } }
StringUtils { public static boolean matchesIgnoreCase(String a, String b, int posA) { int posB; char cA; char cB; if(posA < (posB = b.length())) return false; while(posB > 0) { if(!Character.isLowerCase(cA = a.charAt(--posA))) cA = Character.toLowerCase(cA); if(!Character.isLowerCase(cB = b.charAt(--posB))) cB = Character.toLowerCase(cB); if(cA != cB) return false; } return true; } private  StringUtils(); }
StringUtils { public static boolean matchesIgnoreCase(String a, String b, int posA) { int posB; char cA; char cB; if(posA < (posB = b.length())) return false; while(posB > 0) { if(!Character.isLowerCase(cA = a.charAt(--posA))) cA = Character.toLowerCase(cA); if(!Character.isLowerCase(cB = b.charAt(--posB))) cB = Character.toLowerCase(cB); if(cA != cB) return false; } return true; } private  StringUtils(); static boolean endsWithIgnoreCase(String a, String b); static boolean matchesIgnoreCase(String a, String b, int posA); static boolean endsWithIgnoreCase(String a, char[] b); static boolean matchesIgnoreCase(String a, char[] b, int posA); static boolean endsWith(String a, char[] b); static boolean matches(String a, char[] b, int posA); static boolean startsWithIgnoreCase(String a, String b); static boolean equals(String s1, String s2, Locale locale); static boolean equals(String s1, String s2, boolean caseSensitive); static int parseIntDef(String s, int def); static String capitalize(String s); static String flatten(String s[]); static String flatten(String s[], String separator); static boolean isNullOrEmpty(String string); }
StringUtils { public static boolean matchesIgnoreCase(String a, String b, int posA) { int posB; char cA; char cB; if(posA < (posB = b.length())) return false; while(posB > 0) { if(!Character.isLowerCase(cA = a.charAt(--posA))) cA = Character.toLowerCase(cA); if(!Character.isLowerCase(cB = b.charAt(--posB))) cB = Character.toLowerCase(cB); if(cA != cB) return false; } return true; } private  StringUtils(); static boolean endsWithIgnoreCase(String a, String b); static boolean matchesIgnoreCase(String a, String b, int posA); static boolean endsWithIgnoreCase(String a, char[] b); static boolean matchesIgnoreCase(String a, char[] b, int posA); static boolean endsWith(String a, char[] b); static boolean matches(String a, char[] b, int posA); static boolean startsWithIgnoreCase(String a, String b); static boolean equals(String s1, String s2, Locale locale); static boolean equals(String s1, String s2, boolean caseSensitive); static int parseIntDef(String s, int def); static String capitalize(String s); static String flatten(String s[]); static String flatten(String s[], String separator); static boolean isNullOrEmpty(String string); static final String EMPTY; }