List of utility methods to do String Sub String
String | substring(String source, int beginIndex, int endIndex) Returns a string that is a substring of this string. if (beginIndex < 0) throw new StringIndexOutOfBoundsException(beginIndex); if (endIndex > source.length()) throw new StringIndexOutOfBoundsException(endIndex); int subLen = endIndex - beginIndex; if (subLen < 0) throw new StringIndexOutOfBoundsException(subLen); String toreturn = ""; ... |
String | substring(String source, int length, String padding) substring if (source == null) { return ""; String s = source.trim(); char c; int size = 0; int count = s.length(); StringBuilder buffer = new StringBuilder(); ... |
String | substring(String source, int offset, int dataLength) substring StringBuilder sb = new StringBuilder(); if (!isEmpty(source) && source.length() >= offset + dataLength) { sb.append(source.substring(offset, offset + dataLength)); return sb.toString(); |
String | substring(String source, int size) substring return substring(source, 0, size);
|
String | substring(String source, int startIndex) substring if (source == null) return null; int length = source.length(); if (startIndex < 0) startIndex = 0; if (length < startIndex) return ""; else ... |
String | subString(String source, int startIndex, int count) sub String if (source == null || source.equals("")) { return null; if (source.length() - startIndex > count) { count = source.length() - startIndex; if (startIndex <= 0) { startIndex = 0; ... |
String | substring(String src, int beginIndex, int endIndex) substring if (src.length() < beginIndex) return ""; return src.substring(beginIndex, endIndex); |
String | substring(String src, int start_idx, int end_idx) substring byte[] b = src.getBytes(); String tgt = ""; for (int i = start_idx; i <= end_idx; i++) { tgt += (char) b[i]; return tgt; |
String | subString(String src, int startIndex, int endIndex) Find substring start by one index end by index if ((startIndex == -1) || (endIndex == -1)) { return null; return src.substring(startIndex, endIndex); |
String | subString(String src, String begin, String end) sub String return subString(src, 0, begin, end);
|