List of utility methods to do String Sub String Get
String | left(String str, int length) left if (str == null) { return null; if (length < 0) { return EMPTY; if (str.length() <= length) { return str; ... |
String | right(String str, int length) right if (str == null) { return null; if (length < 0) { return EMPTY; if (str.length() <= length) { return str; ... |
String | delSuffix(String str) del Suffix int index = str.lastIndexOf("."); if (index >= 0) { return str.substring(0, index); } else { return str; |
String | deleteLast(String str, int num) delete Last if (str == null) return null; return str.substring(0, str.length() - num); |
String | deleteLastIf(String str, String eq_str) delete Last If if (str == null) return null; if (str.substring(str.length() - eq_str.length(), str.length()) .equals(eq_str)) { return str.substring(0, str.length() - eq_str.length()); } else { return str; |
String | getTailorString(String string, int length) get Tailor String if (string == null) { return null; if (string.length() <= length) return string; StringBuilder sb = new StringBuilder( string.substring(0, length - 1)); sb.append("."); ... |
String | mid(String str, int beginIndex, int length) mid if (str == null) { return null; if (length < 0 || beginIndex > str.length()) { return EMPTY; if (beginIndex < 0) { beginIndex = 0; ... |
String | subStringByByte(String str, int startPos, int length) sub String By Byte if (str == null || str.length() == 0) { return ""; StringBuffer sb = new StringBuffer(); int byteLen = 0; for (int i = 0; i < str.length(); i++) { int ascii = Character.codePointAt(str, i); if (ascii >= 0 && ascii <= 255) { ... |
String | subStringByByte(String paramString, int beginIndex, int endIndex) sub String By Byte if ((paramString == null) || (paramString.length() == 0)) { return ""; if (beginIndex >= endIndex) { return ""; int byteLength = 0; String returnString = ""; ... |
String | subString(String source, String start, int offsetStart, String end, int offsetEnd) Substring return source.substring(source.indexOf(start) + offsetStart,
source.indexOf(offsetEnd) + offsetEnd);
|