public boolean endsWith(CharSequence suffix) {
        int suffixLen = suffix.length();
        return regionMatches(length() - suffixLen, suffix, 0, suffixLen);
    }
public boolean endsWith ( CharSequence suffix ) { int suffixLen = suffix . length ( ) ; return regionMatches ( length ( ) - suffixLen , suffix , 0 , suffixLen ) ; }
Compares the specified string to this string to determine if the specified string is a suffix.

@param suffix the suffix to look for.
@return {@code true} if the specified string is a suffix of this string, {@code false} otherwise.
@throws NullPointerException if {@code suffix} is {@code null}.