List of utility methods to do String Sub String
String | substringAfter(String str, String separator) Gets the substring after the first occurrence of a separator. if (isEmpty(str)) { return str; if (separator == null) { return EMPTY; int pos = str.indexOf(separator); if (pos == -1) { ... |
String | substringAfter(String str, String separator) substring After if (isEmpty(str)) { return str; } else if (separator == null) { return ""; } else { int pos = str.indexOf(separator); return pos == -1 ? "" : str.substring(pos + separator.length()); |
String | substringAfter(String str, String separator) Gets the substring after the first occurrence of a separator. if (isEmpty(str)) { return str; if (separator == null) { return EMPTY; int pos = str.indexOf(separator); if (pos == -1) { ... |
String | substringAfter(String string, String delim) Returns the substring after the delimiter string, not including the delimiter string. int pos = string.indexOf(delim); if (pos == 0) return string; else if (pos > 0) return string.substring(pos + delim.length()); else return null; |
String | substringAfter(String string, String delimiter) substring After int pos = string.indexOf(delimiter); return pos >= 0 ? string.substring(pos + delimiter.length()) : ""; |
String | substringAfter(String template, String toFind, String defaultTo) Searches a given string ( template ) for a substring ( toFind ) and returns the portion of the string that follows the substring. int toFindLength = toFind.length(); int toFindOffset = template.indexOf(toFind); int substringOffset = toFindOffset + toFindLength; String returnValue; if (toFindOffset == -1) { returnValue = defaultTo; } else { returnValue = template.substring(substringOffset); ... |
String | substringAfter(String text, int index) substring After if (index == INDEX_NOT_FOUND) { return EMPTY; return text.substring(index + 1, text.length()); |
String | substringAfter(String text, String after) Returns the portion of the overall string that comes after the first occurance of the given string. int indexOf = text.indexOf(after); if (indexOf == -1) { return text; return text.substring(indexOf + after.length()); |
String | substringAfter(String value, char delim) substring After if (value == null) { return null; int pos = value.indexOf(delim); if (pos >= 0) { return value.substring(pos + 1); return null; ... |
String | substringAfterFirstIndex(String value) Omits the first character and returns the remaining string. if (null == value || value.isEmpty()) { return ""; return value.substring(1); |