List of utility methods to do String Sub String Get
String | replaceOnce(String source, String subject, String object) replace Once StringBuffer rtnStr = new StringBuffer(); String preStr = ""; String nextStr = source; if (source.indexOf(subject) >= 0) { preStr = source.substring(0, source.indexOf(subject)); nextStr = source.substring( source.indexOf(subject) + subject.length(), source.length()); ... |
String | substring(String str, int toCount) substring return substring(str, toCount, ".."); |
String | substring(String str, int len, String more) substring if (str == null || "".equals(str) || len < 1) { return ""; char[] chars = str.toCharArray(); int count = 0; int charIndex = 0; for (int i = 0; i < chars.length; i++) { int charLength = getCharLen(chars[i]); ... |
String | substringFromLast(final String str, final String separator) substring From Last if (isEmpty(str) || isEmpty(separator)) { return str; int pos = str.lastIndexOf(separator); if (pos == -1) { return str; return str.substring(0, pos); ... |
String | substringToLast(final String str, final String separator) substring To Last if (isEmpty(str) || isEmpty(separator)) { return str; int pos = str.lastIndexOf(separator); if (pos == -1) { return str; return str.substring(pos + 1, str.length()); ... |
String | takeOutFirstChar(String input) take Out First Char if (input.charAt(0) == '#') { String re = input.substring(1, input.length()); return re; return input; |
String | substring(String str, int srcPos, int specialCharsLength) substring if (str == null || "".equals(str) || specialCharsLength < 1) { return ""; if (srcPos < 0) { srcPos = 0; if (specialCharsLength <= 0) { return ""; ... |
String | substringAfter(String text, char c) Gives the substring of the given text after the given separator. if (isEmpty(text)) { return text; int cPos = text.indexOf(c); if (cPos < 0) { return ""; return text.substring(cPos + 1); ... |
String | substringAfterLast(String text, char separator) Gives the substring of the given text after the last occurrence of the given separator. if (isEmpty(text)) { return text; int cPos = text.lastIndexOf(separator); if (cPos < 0) { return ""; return text.substring(cPos + 1); ... |
String | substringBefore(String text, char separator) Gives the substring of the given text before the given separator. if (isEmpty(text)) return text; int sepPos = text.indexOf(separator); if (sepPos < 0) return text; return text.substring(0, sepPos); |