Here you can find the source of endsWithAny(String string, String searchStrings[])
public static boolean endsWithAny(String string, String searchStrings[])
//package com.java2s; //License from project: Open Source License public class Main { public static boolean endsWithAny(String string, String searchStrings[]) { if (isEmpty(string) || (searchStrings == null || searchStrings.length < 1)) return false; for (int i = 0; i < searchStrings.length; i++) { String searchString = searchStrings[i]; if (endsWith(string, searchString)) return true; }/*from w ww. j a v a 2 s . com*/ return false; } public static boolean isEmpty(CharSequence str) { return str == null || str.length() == 0; } public static boolean endsWith(String str, String suffix) { return endsWith(str, suffix, false); } private static boolean endsWith(String str, String suffix, boolean ignoreCase) { if (str == null || suffix == null) { return str == null && suffix == null; } if (suffix.length() > str.length()) { return false; } int strOffset = str.length() - suffix.length(); return str.regionMatches(ignoreCase, strOffset, suffix, 0, suffix.length()); } /** * Gets a String's length or <code>0</code> if the String is * <code>null</code>. * * @param str * a String or <code>null</code> * @return String length or <code>0</code> if the String is * <code>null</code>. * @since 2.4 */ public static int length(String str) { return str == null ? 0 : str.length(); } }