Here you can find the source of endsWithIC(String s1, String s2)
public static boolean endsWithIC(String s1, String s2)
//package com.java2s; public class Main { /**//from www . java2 s . c o m * Returns whether s1 ends with s2, ignoring case. */ public static boolean endsWithIC(String s1, String s2) { return s1 != null && s2 != null && s1.regionMatches(true, s1.length() - s2.length(), s2, 0, s2.length()); } /** * Returns whether s1 ends with any of the given strings, ignoring case. */ public static boolean endsWithIC(String s1, String... strings) { for (String string : strings) if (endsWithIC(s1, string)) return true; return false; } /** * Returns the length of given string (supports null). */ public static int length(CharSequence aString) { return aString == null ? 0 : aString.length(); } }