List of utility methods to do String Split
String[] | splitString(String src, String target) split String return src.split("\\Q" + target + "\\E"); |
Vector | splitString(String string) split String Vector vr = new Vector(); StringTokenizer stok = new StringTokenizer(string, " "); while (stok.hasMoreTokens()) { vr.addElement(stok.nextToken()); return vr; |
List | splitString(String string, int limit) Splits a string by char limit, not breaking works. List<String> list = new ArrayList<String>(); char[] chars = string.toCharArray(); boolean endOfString = false; int start = 0; int end = start; while (start < chars.length - 1) { int charCount = 0; int lastSpace = 0; ... |
String[] | splitStringBySeperator(final String str, final String seperator) split String By Seperator if (str == null) { return null; String sep = seperator; if (sep == null) { sep = " "; if (sep.equals("")) { ... |
void | splitStrings(String start, String end, int numSplitStrings, boolean oddLevel, List Recursive helper for splitStrings. if (numSplitStrings <= 0) { return; String midString = findMidpoint(start, end); int numSplitStringsRemaining = numSplitStrings - 1; int leftOffset = 0; int rightOffset = 0; if (numSplitStringsRemaining % 2 == 1) { ... |
List | splitStringToList(String pstrString, String pstrSep) split String To List if (pstrString == null || pstrSep == null) { return new ArrayList<String>(); return new ArrayList<String>(Arrays.asList(pstrString.split(pstrSep))); |
List | splitStringWithoutTrim(String strInput, String strSplitor) Split String to List List listResult = new ArrayList(); if (strInput == null) { return null; int start = 0; int end = strInput.length(); while (start < end) { int delimIdx = strInput.indexOf(strSplitor, start); ... |
Vector | splitStruct(String struct) split Struct Vector vr = new Vector(); if (struct.startsWith("[") && struct.endsWith("]")) { struct = struct.substring(1, struct.length() - 1); StringTokenizer stok = new StringTokenizer(struct, " "); while (stok.hasMoreTokens()) { String tok = stok.nextToken(); if (tok.startsWith("[")) { ... |
ArrayList | splitSubstring(String str, String substr) split Substring ArrayList<String> split = new ArrayList<String>(); int idx_s = 0; int idx_e = str.indexOf(substr); while (idx_e > -1) { String f = str.substring(idx_s, idx_e); split.add(f.trim()); idx_s = idx_e + substr.length(); idx_e = str.indexOf(substr, idx_s); ... |
ArrayList | splitTags(final String tagsString) Split tags. final ArrayList<String> tagsList = new ArrayList<String>(); String tagsCopy = tagsString; if (tagsString == null) { return tagsList; tagsCopy = tagsCopy.replaceAll(",", " "); tagsCopy = tagsCopy.replaceAll("\"", ""); tagsCopy = tagsCopy.replaceAll("\'", ""); ... |