List of utility methods to do String Split by Regex
void | splitString(String str, List split String int indexOf = str.indexOf(regex); if (indexOf > -1) { list.add(str.substring(0, indexOf)); splitString(str.substring(indexOf + 1, str.length()), list, regex); } else { list.add(str); |
List | splitStringToList(String input, String regex) splits a string on a regex delimeter and converts the resulting array to a List if (input == null) { return Collections.emptyList(); List<String> results = new ArrayList<String>(); for (String value : input.split(regex)) { results.add(value.trim()); return results; ... |
List | splitTerms(String text, String pattern) Splits the passed string around matches of the given pattern. List<String> l = new ArrayList<String>(); if (text == null) return l; text = text.trim(); String[] r = text.split(pattern); String value; for (int i = 0; i < r.length; i++) { value = r[i]; ... |
List | splitToList(String s, String regex) split To List List<String> list = new ArrayList<String>(); for (String item : s.split(regex)) { if (!item.isEmpty()) { list.add(item); return list; |
List | splitToLongList(String str, String regex) split a string to a List String[] strList = str.split(regex);
return convertStrArrayToLongList(strList);
|