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

booleanendsWithSingleQuoteS(String s)
True if string ends with "single quote + s".
int l = s.length();
return (l > 1) && ((s.charAt(l - 1) == 's') || (s.charAt(l - 1) == 'S')) && isSingleQuote(s.charAt(l - 2));
booleanendsWithSlash(final String path)
ends With Slash
if (isEmpty(path)) {
    return false;
return path.lastIndexOf("/") == path.length() - 1;
booleanendsWithSomeChar(char cs[], String activationToken)
Checks if the activationToken ends with some char from cs.
for (int i = 0; i < cs.length; i++) {
    if (activationToken.endsWith(cs[i] + "")) {
        return true;
return false;
booleanendsWithSpace(String s)
ends With Space
if (s != null && s.length() > 0) {
    char last = s.charAt(s.length() - 1);
    if (last == ' ')
        return true;
return false;
booleanendsWithSpaces(final String text)
ends With Spaces
final char ch = text.charAt(text.length() - 1);
return Character.isWhitespace(ch);
booleanendsWithStarsPattern(String text, int from)
ends With Stars Pattern
if (from < 0)
    from = 0;
for (; from < text.length(); from++) {
    char c = text.charAt(from);
    if (c != '*' && c != '%')
        return false;
return true;
...
booleanendsWithStartOfOther(String text, String textOther)
Returns true if the given text ends with the start of the other given text.
boolean retval = false;
return retval;
booleanendsWithStop(String str)
Ends with stop.
if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!")) {
    return true;
return false;
booleanendsWithWhitespace(final CharSequence charSeq)
Finds out if the given character sequence ends with a whitespace character.
if (charSeq.length() == 0) {
    return false;
return Character.isWhitespace(charSeq.charAt(charSeq.length() - 1));
booleanendsWithWhitespace(String s)
ends With Whitespace
return (s.length() > 0) && Character.isWhitespace(s.charAt(s.length() - 1));