List of utility methods to do String to List
List | convertStringToEnumList(Class convert String To Enum List List<T> enumList = new ArrayList<T>(); for (String string : stringList) { enumList.add(Enum.valueOf(enumType, string)); return enumList; |
List | convertStringToList(String str) convert String To List List<String> stList = new ArrayList<>(); stList.add(str); return stList; |
List | convertStringToList(String string, String delimiter, boolean trim) Converts string to list. if (string == null || string.length() == 0) { return new LinkedList(); String[] members = string.split(delimiter); List list = Collections.synchronizedList(new LinkedList()); for (int i = 0; i < members.length; i++) { String member = members[i]; if (trim) { ... |
List | convertStringToList(String value, String delimiter) convert String To List List<String> list = null; if (value != null) { list = Arrays.asList(value.split(",")); return list; |
List | convertTextToStringList(String tagText) Convert tag text to list of seperated words List<String> result = new ArrayList<String>(); StringBuilder builder = new StringBuilder(); if (allUpperCase(tagText) || allLowerCase(tagText)) { result.add(tagText); } else { for (int i = tagText.length() - 1; i >= 0; --i) { char ch = tagText.charAt(i); if (Character.isLowerCase(ch)) { ... |
List | convertTextToStringList(String text) convert Text To String List List<String> list = null; if (text != null) { text = text.replace("\r\n", "\n"); text = text.replace("\n\r", "\n"); text = text.replace("\r", "\n"); String[] split = text.split("\n"); list = Arrays.asList(split); return list; |
List | convertToList(String inputString) converts a given comma separated String into a list of Strings ArrayList<String> list = new ArrayList<String>(); if (inputString == null || inputString.equals("")) { return list; String[] strings = inputString.split(","); for (String s : strings) { list.add(s); return list; |
List | convertToList(String str) Create an ArrayList and add the str value to its 0 index and return it. if (str == null) return null; List<String> strList = new ArrayList<String>(); strList.add(str); return strList; |
List | convertToList(String string, String delim) Construct a list from a string. String elem_d = "\\Q" + delim + "\\E"; String elems[] = string.split(elem_d); return new ArrayList<String>(Arrays.asList(elems)); |
List | convertToList(String vars) Converts comma-separated string into a list. List<String> resultList = new ArrayList<String>(); String[] resultArray = vars.split(STRING_LIST_SEPARATOR); for (String var : resultArray) { var = var.trim(); if (var.length() > 0) { resultList.add(var); return resultList; |