Java Utililty Methods String Tail

List of utility methods to do String Tail

Description

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

Method

Stringtail(final String text, final char ch)
tail
final int indx = text.lastIndexOf(ch);
return (indx != -1) ? text.substring(indx + 1) : text;
Stringtail(final String text, final char ch)
Return the string after the last occurance of the given character in the given string.
final int indx = text.lastIndexOf(ch);
return (indx != -1) ? text.substring(indx + 1) : text;
Stringtail(String s, char ch)
Returns s.substring(s.lastIndexOf(ch) + 1).
return s.substring(s.lastIndexOf(ch) + 1);
Stringtail(String s, String separator)
tail
if (s == null)
    return null;
int idx = s.lastIndexOf(separator);
if (idx >= 0)
    return s.substring(idx + 1);
else
    return s;
Stringtail(String src, String dividerRegex)
tail
String[] splitList = src.split(dividerRegex);
if (splitList.length == 0)
    return src;
else
    return splitList[splitList.length - 1];
Stringtail(String text, String separator)
gets the tail part of the given text after the given separator.
int pos = text.lastIndexOf(separator);
return pos != -1 ? text.substring(pos + 1) : text;
StringtailOf(String s, char separator)
tail Of
int index = s.indexOf(separator);
if (index < 0)
    return "";
return s.substring(index + 1);
StringtailOfString(String input, String sub)
Returns everything to the right of the specified string.
String retString = null;
if (input != null) {
    int lastIdx = input.indexOf(sub);
    if (lastIdx != -1)
        retString = input.substring(lastIdx + sub.length());
    else
        retString = input;
return retString;