Here you can find the source of endsWithIgnoreCase(String source, String suffix)
public static boolean endsWithIgnoreCase(String source, String suffix)
//package com.java2s; import android.text.TextUtils; public class Main { /**/*from w w w . j av a2 s . c o m*/ * Whether the given source string ends with the given suffix, ignoring case. */ public static boolean endsWithIgnoreCase(String source, String suffix) { if (isEmpty(suffix)) return true; if (isEmpty(source)) return false; if (suffix.length() > source.length()) return false; return source.substring(source.length() - suffix.length()) .toLowerCase().endsWith(suffix.toLowerCase()); } /** * Whether the given string is null or zero-length */ public static boolean isEmpty(String text) { return TextUtils.isEmpty(text); } }