Java Utililty Methods String Ends With

List of utility methods to do String Ends With

Description

The list of methods to do String Ends With are organized into topic(s).

Method

booleanendsWith(int[] data, int[] ends)
ends With
if (data == null || ends == null) {
    return false;
if (data.length < ends.length) {
    return false;
int start = data.length - ends.length;
for (int i = 0; i < ends.length; i++) {
...
booleanendsWith(String a, char[] b)
Equivalent of String.endsWith(String) using a char[].
return matches(a, b, a.length());
booleanendsWith(String baseString, String compareString)
endWith
if (baseString == null)
    return false;
else
    return baseString.endsWith(compareString);
booleanendsWith(String filePath, String extension)
ends With
return filePath.toLowerCase().endsWith(extension);
booleanendsWith(String fullString, String subString)
Null Pointer proof String.endsWith() method.
if (fullString == null)
    return false;
if (subString == null)
    return false;
return fullString.endsWith(subString);
BooleanendsWith(String haystack, String needle)
__UNDOCUMENTED__
if ((haystack != null) && (needle != null)) {
    return new Boolean(haystack.endsWith(needle));
return Boolean.FALSE;
booleanendsWith(String in, String str)
Tests if the given string ends with the specified suffix.
char[] c = str.toCharArray();
for (char element : c) {
    if (in.endsWith(String.valueOf(element))) {
        return true;
return false;
booleanendsWith(String inEnd, String inValue)
NPE safe String startsWith
if (inEnd == null && inValue == null) {
    return true;
} else if (inEnd == null || inValue == null) {
    return false;
return inValue.endsWith(inEnd);
booleanendsWith(String receiver, String... needles)
ends With
return endsWith(receiver, false, needles);
booleanendsWith(String s, char c)
An efficient method for checking if a string ends with a character.
if (s != null) {
    int i = s.length();
    if (i > 0)
        return s.charAt(i - 1) == c;
return false;