The list of methods to do String Tail are organized into topic(s).
String
tail(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;
String
tail(String s, char ch) Returns s.substring(s.lastIndexOf(ch) + 1).
return s.substring(s.lastIndexOf(ch) + 1);
String
tail(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;
String
tail(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;
String
tailOfString(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;