List of utility methods to do String Split
List | splitTags(String rawTags) split Tags rawTags = rawTags.trim(); String[] tags = rawTags.split(","); List<String> currentTags = new ArrayList<String>(); for (String tag : tags) { String effectiveTag = tag.replace(",", "").trim(); if (!"".equals(effectiveTag)) { currentTags.add(effectiveTag); if ("".equals(rawTags)) { return Arrays.asList((String[]) new String[] { "" }); if (rawTags.charAt(rawTags.length() - 1) == ',') { currentTags.add(""); return currentTags; |
String[] | splitTemplateName(String templateName) Splits template name to get identifier, field name and locale ArrayList result = new ArrayList(); int k = templateName.lastIndexOf("_"); if (k != -1) { String locale = templateName.substring(k + 1); templateName = templateName.substring(0, k); k = templateName.lastIndexOf("_"); if (k != -1) { String field = templateName.substring(k + 1); ... |
List
| splitter(List splitter List<List<T>> parts = new ArrayList<List<T>>(); final int N = list.size(); for (int i = 0; i < N; i += L) { parts.add(list.subList(i, Math.min(N, i + L))); return parts; |
String[] | splitTerms(String queryString) split Terms final List<String> result = new ArrayList<String>(); final StringBuilder builder = new StringBuilder(); final int len = queryString.length(); for (int i = 0; i < len; ++i) { final int cp = queryString.codePointAt(i); if (!Character.isLetterOrDigit(cp) && cp != ':' && cp != '+' && cp != '^' && cp != '-') { if (builder.length() > 0) { result.add(builder.toString()); ... |
List | splitText(String text) Split text into lines. int startLine = 0; int i = 0; int n = text.length(); ArrayList<String> rc = new ArrayList<String>(); while (i < n) { switch (text.charAt(i)) { case '\n': i++; ... |
List | splitToInteger(String str) split To Integer String[] chars = str.split(""); List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < chars.length; i++) { try { list.add(new Integer(chars[i])); } catch (NumberFormatException nfe) { return list; |
List | splitTokens(final String targets) Simple function to split a string into tokens which are loaded into a list, note order IS important. if (targets.matches(".*\\s.*")) { return Arrays.asList(targets.split("\\s+")); } else { return Arrays.asList(targets); |
List | splitTokens(String text) split Tokens return splitTokens(text, ","); |
List | splitToList(final String listString, final String split) split To List return splitToList(listString, split, false);
|
List | splitToList(String s) split To List return Arrays.asList(split(s));
|