List of utility methods to do String Sub String
String | SubString(String x, long y) Sub String return x.substring((int) y); |
String | substring(StringBuffer buf, int start, int lim) substring int len = lim - start; char[] result = new char[len]; buf.getChars(start, lim, result, 0); return String.valueOf(result); |
String | substring2ByteString(String str, int endIndex) substring Byte String if (str == null) { return null; byte[] strByte = str.getBytes(); int i, strLen; strLen = strByte.length; if (strLen <= endIndex) { return str; ... |
String | subString4lastIndex(String string, String regex) sub Stringlast Index if (isNullOrEmpty(string) || isNullOrEmpty(regex)) { return string; if (string.indexOf(regex) == -1) { return string; return string.substring(string.lastIndexOf(regex) + regex.length()); |
String | substringAfter(final String str, final String separator) substring After if (isEmpty(str)) { return str; if (separator == null) { return EMPTY; final int pos = str.indexOf(separator); if (pos == INDEX_NOT_FOUND) { ... |
String | substringAfter(String s, String cs) substring After int idx = s.indexOf(cs); if (idx >= 0) { return s.substring(idx + cs.length()); } else { return null; |
String | substringAfter(String s, String substr, boolean fromend) Return the string after a given substring int p = fromend ? s.lastIndexOf(substr) : s.indexOf(substr); return (p >= 0) ? s.substring(p + 1) : s; |
String | substringAfter(String sourceStr, String expr) substring After if (isEmpty(sourceStr) || expr == null) { return sourceStr; if (expr.length() == 0) { return sourceStr; int pos = sourceStr.indexOf(expr); if (pos == -1) { ... |
String | substringAfter(String str, int beginChar, boolean last) substring After if (str == null) { return null; if (beginChar < 0) { return str; int idx = (last) ? str.lastIndexOf(beginChar) : str.indexOf(beginChar); if (idx == -1) { ... |
String | substringAfter(String str, String delimiter) substring After int indexOf = str.indexOf(delimiter); return str.substring(indexOf + delimiter.length(), str.length()); |