List of utility methods to do String to List
List | stringToList(String input) string To List List<String> list = new ArrayList<String>(); for (String element : input.split("-")) { list.add(element); return list; |
List | stringToList(String keywords, String delimiter) string To List if (keywords == null || keywords.length() == 0 || delimiter == null || delimiter.length() == 0 | keywords.indexOf(delimiter) < 0) return Collections.emptyList(); final List<String> elements = new ArrayList<String>(); int index = -1; while ((index = keywords.indexOf(delimiter)) >= 0) { if (index > 0) elements.add(keywords.substring(0, index)); ... |
List | stringToList(String listString, String delimiter) string To List ArrayList<String> result = new ArrayList<String>(); int last = -1; if (listString != null && !listString.isEmpty()) { while (listString.indexOf(delimiter, ++last) != -1) { result.add(listString.substring(last, listString.indexOf(delimiter, last))); last = listString.indexOf(delimiter, last); result.add(listString.substring(last, listString.length())); ... |
List | stringToList(String listText) string To List if (listText == null || listText.equals("")) { return null; List<Object> list = new ArrayList<Object>(); String[] text = listText.split(SEP1); for (String str : text) { list.add(str); return list; |
List | StringToList(String listText, String regex) String To List if (listText == null || listText.equals("")) { return null; List<String> list = new ArrayList<String>(); if (listText.contains(regex)) { String[] text = listText.split(regex); for (String str : text) { list.add(str.replaceAll("\\s*", "")); ... |
List | stringToList(String s) string To List return Arrays.asList(splitOnSpaces(s));
|
ArrayList | stringToList(String s) string To List ArrayList<String> l = new ArrayList<String>(); if ((s != null) && (s.length() > 0)) { String[] stringTokens = s.split("\\s"); for (int i = 0; i < stringTokens.length; i++) l.add(stringTokens[i].toUpperCase()); return l; |
List | stringToList(String s) string To List return stringToList(s, null);
|
List | stringToList(String source) Comma separated strings to List return Arrays.asList(source.split("\\s*,\\s*")); |
List | stringToList(String sText) string To List if (sText == null || sText.length() == 0) return new ArrayList(0); if (sText.startsWith("[") && sText.endsWith("]")) { sText = sText.substring(1, sText.length() - 1); ArrayList arrayList = new ArrayList(); int iIndexOf = 0; int iBegin = 0; ... |