Here you can find the source of endsWithIgnoreCase(String str, String suffix)
public static boolean endsWithIgnoreCase(String str, String suffix)
//package com.java2s; //License from project: Mozilla Public License public class Main { public static boolean endsWithIgnoreCase(String str, String suffix) { return endsWith(str, suffix, true); }/*from w w w . j a v a2s. co m*/ 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()); } public static int length(String str) { return str == null ? 0 : str.length(); } }