List of utility methods to do String Sub String
String | subString(String str, int end) sub String return subString(str, 0, end, "..."); |
String | substring(String str, int index, int length) substring if (str == null) { return null; int len = str.length(); if (index + length > len) { length = len - index; return str.substring(index, length); ... |
String | subString(String str, int len) sub String if (len < 0) { return str; if ("".equals(str) || str == null) { return null; } else if (str.length() <= len) { return str; } else { ... |
String | substring(String str, int len) substring len = len * 2; StringBuffer sb = new StringBuffer(); int counter = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c < 255) { counter++; } else { ... |
String | subString(String str, int num, String token) sub String String str1 = str; if (str != null && str.trim().length() > num) { str1 = str.substring(0, num); if (token != null) { str1 = str1 + token; return str1; ... |
String | substring(String str, int off, int len) this method works different from the regular substring method, the regular substring method takes startIndex and endIndex as second and third argument, this method takes offset and length return str.substring(off, off + len);
|
String | subString(String str, int offset, int leng) sub String return new String(str.getBytes(), (offset - 1), leng); |
String | substring(String str, int start) Gets a substring from the specified String avoiding exceptions. A negative start position can be used to start A if (str == null) { return null; if (start < 0) { start = str.length() + start; if (start < 0) { start = 0; ... |
String | substring(String str, int start) substring if (str == null) return null; if (start < 0) start = str.length() + start; if (start < 0) start = 0; return (start > str.length()) ? "" : str.substring(start); |
String | substring(String str, int start) substring if (str == null) { return null; if (start < 0) { start = str.length() + start; if (start < 0) { start = 0; ... |