List of utility methods to do String Sub String
String | subString(String parentStr, String startStr, String endStr) sub String return parentStr.substring(parentStr.indexOf(startStr) + startStr.length(), parentStr.indexOf(endStr));
|
String | substring(String S, int beginIndex, int endIndex) substring if (beginIndex < endIndex && beginIndex >= 0 && endIndex <= S.length()) { return S.substring(beginIndex, endIndex); } else { return ""; |
String | substring(String s, int beginIndex, int endIndex) substring while (beginIndex < endIndex && s.charAt(beginIndex) <= ' ') beginIndex++; while (beginIndex < endIndex && s.charAt(endIndex - 1) <= ' ') endIndex--; return beginIndex < endIndex ? s.substring(beginIndex, endIndex) : ""; |
String | substring(String s, int i, String substring, int direction) substring if (direction >= 0) { return s.substring(i + substring.length()); } else { return s.substring(0, i); |
String | subString(String s, int length) sub String if (isBlank(s)) return ""; if (s.getBytes().length <= length) return s; char ch[] = null; if (s.length() >= length) ch = s.substring(0, length).toCharArray(); else ... |
String | substring(String s, int start) substring if (s == null || start >= s.length()) { return ""; return s.substring(start); |
String | substring(String s, int start, int length) Extract a substring from the given string, using start index and length of the extracted substring. if (!hasLength(s)) { return s; if (start < 0) start = 0; if (start + 1 > s.length() || length < 0) return ""; return (start + length > s.length()) ? s.substring(start) : s.substring(start, start + length); ... |
String | substring(String s, int start, int stop) substring if (isEmpty(s)) { return s; if (start < 0 || start >= s.length()) { return ""; if (stop > s.length() || stop < 0) { stop = s.length(); ... |
String | subString(String s, int startIndex, int count) slice up the given string if (isEmpty(s)) { return ""; byte[] stringBytes = s.getBytes(); if (startIndex < 0) { startIndex = 0; if (count > stringBytes.length - startIndex) { ... |
String | substring(String self, Integer startIndex, Integer endIndex) substring return self.substring(startIndex, endIndex);
|