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

booleanendsWith3(String string, int char1, int char2, int char3)
Return true if the three-character substring occurs at the end of the given string.
int length = string.length();
return length >= 3 && string.charAt(length - 3) == char1 && string.charAt(length - 2) == char2
        && string.charAt(length - 1) == char3;
booleanendsWithAny(final byte[] str, int startIndex, int endIndex, final byte... chars)
ends With Any
if (startIndex < 0) {
    startIndex = 0;
if (endIndex > str.length) {
    endIndex = str.length;
if (startIndex >= endIndex) {
    return false;
...
booleanendsWithAny(String str, String... args)
ends With Any
if (str != null) {
    for (String s : args) {
        if (str.endsWith(s))
            return true;
return false;
booleanendsWithAny(String string, String searchStrings[])
ends With Any
if (isEmpty(string) || (searchStrings == null || searchStrings.length < 1))
    return false;
for (int i = 0; i < searchStrings.length; i++) {
    String searchString = searchStrings[i];
    if (endsWith(string, searchString))
        return true;
return false;
...
booleanendsWithAny(String stringToMatch, String... stringToCheckEquals)
ends With Any
for (final String candidate : stringToCheckEquals) {
    if (stringToMatch.endsWith(candidate)) {
        return true;
return false;
booleanendsWithAnyCI(String string, String... suffixes)
ends With Any CI
string = string.toLowerCase();
for (String suffix : suffixes)
    if (string.endsWith(suffix.toLowerCase()))
        return true;
return false;
booleanendsWithAnyIC(String str, String[] needles)
ends With Any IC
if (str == null || str.length() == 0 || needles == null || needles.length == 0)
    return false;
str = str.toLowerCase();
for (String n : needles) {
    if (str.endsWith(n))
        return true;
return false;
...
booleanendsWithBackslash(final String s)
ends With Backslash
return s.endsWith("\\") && s.endsWith("\\\\") == false;
booleanendsWithChar(CharSequence s, char suffix)
ends With Char
return s != null && s.length() != 0 && s.charAt(s.length() - 1) == suffix;
booleanendsWithChar(final String s, final char c)
ends With Char
if (s == null || s.length() == 0) {
    return false;
return s.charAt(s.length() - 1) == c;