List of utility methods to do String to List
ArrayList | toList(String str) Converts a string to a list of Characters. ArrayList<Character> myArrayList = new ArrayList<>(str.length()); for (int i = 0; i < str.length(); i++) { myArrayList.add(i, str.charAt(i)); return myArrayList; |
ArrayList | toList(String string) Converts a string to a new, mutable list of Characters. ArrayList<Character> list = new ArrayList<Character>(string.length()); for (char c : string.toCharArray()) { list.add(c); return list; |
Collection | toList(String text) to List HashSet<String> list = null; if (text == null) { return list; String[] split = text.split(DELIMITER); if (split == null || split.length == 0) { return list; list = new HashSet<>(); Collections.addAll(list, split); return list; |
List | toList(String transaction) to List String[] items = transaction.trim().split(","); List<String> list = new ArrayList<String>(); for (String item : items) { list.add(item); return list; |
List | toList(String val) to List List<String> list = new ArrayList<String>(); int len = val.length(); int inside = 0; char c; int begin = 0; for (int i = 0; i < len; i++) { c = val.charAt(i); if (c == '"') { ... |
List | toList(String val, String separator) to List List<String> list = new ArrayList<String>(); if (!isEmpty(val) && val.indexOf(separator) > -1) { String[] arr = val.split(separator); for (String item : arr) { if (!isEmpty(item)) { list.add(item); return list; |