List of utility methods to do String Sub String
String | substring(String str, int start, int end) substring if (str == null) return null; byte[] data = str.getBytes(); if (data.length < start) { return ""; int realEnd = end >= data.length ? data.length : end; int length = realEnd - start; ... |
String | substring(String str, int start, int end) Find substring of a string. String result = ""; if (str != null) { try { result = str.substring(start, end); } catch (Exception e) { return result; ... |
String | subString(String str, int start, int end) sub String int strLen = str.length(); start = start > strLen ? strLen : start; start = start > 0 ? start : 0; if (end == -1) { end = strLen; } else { end = end > strLen ? strLen : end; return str.substring(start, end); |
String | substring(String str, int toCount) substring if (str == null) return ""; int reInt = 0; StringBuilder reStr = new StringBuilder(); char[] tempChar = str.toCharArray(); int len = tempChar.length; for (int kk = 0; (kk < len && toCount > reInt); kk++) { char currentChar = tempChar[kk]; ... |
String | substring(String str, int toCount, String more) substring int reInt = 0; String reStr = ""; if (str == null) return ""; char[] tempChar = str.toCharArray(); for (int kk = 0; (kk < tempChar.length && toCount > reInt); kk++) { String s1 = str.valueOf(tempChar[kk]); byte[] b = s1.getBytes(); ... |
String | substring(String str, String delim) substring return substring(str, delim, false);
|
String | subString(String string, int beginIndex, int length) Gets the sub string of the given string. final int endIndex = beginIndex + length; if (beginIndex >= string.length()) { return EMPTY; if (endIndex > string.length()) { return string.substring(beginIndex, string.length()); return string.substring(beginIndex, endIndex); ... |
String | subString(String string, int index) sub String if (string == null) return null; return string.substring(index); |
String | substring(String string, int init, int end) Extrae una subcadena, donde los indices pueden ser negativos if (init < 0) { init += string.length(); if (end < 0) { end += string.length(); return string.substring(init, end); |
String | substring(String string, int maxChars, String suffix) substring if (string.length() > maxChars) { return string.substring(0, maxChars - 1) + suffix; return string; |