Here you can find the source of endsWithIgnoreCase(String str, String suffix)
public static boolean endsWithIgnoreCase(String str, String suffix)
//package com.java2s; public class Main { public static boolean endsWithIgnoreCase(String str, String suffix) { if (str == null || suffix == null) { return false; }// w w w.j a v a 2s.c o m if (str.endsWith(suffix)) { return true; } if (str.length() < suffix.length()) { return false; } String lcStr = str.substring(str.length() - suffix.length()).toLowerCase(); String lcSuffix = suffix.toLowerCase(); return lcStr.equals(lcSuffix); } }