Here you can find the source of endsWithIgnoreCase(final String base, final String end)
Parameter | Description |
---|---|
base | the base string. |
end | the ending text. |
public static boolean endsWithIgnoreCase(final String base, final String end)
//package com.java2s; //License from project: LGPL public class Main { /**//ww w .jav a2 s . com * Helper functions to query a strings end portion. The comparison is case insensitive. * * @param base the base string. * @param end the ending text. * * @return true, if the string ends with the given ending text. */ public static boolean endsWithIgnoreCase(final String base, final String end) { if (base.length() < end.length()) { return false; } return base.regionMatches(true, base.length() - end.length(), end, 0, end.length()); } public static int length(String str) { if (str == null) return 0; return str.length(); } }