List of utility methods to do Comma Separated List
String | commaSeparatedString(List Iterates over a list of strings and appends them. StringBuilder sb = new StringBuilder(); String sep = ""; for (String item : items) { sb.append(sep); sb.append(item); sep = ","; return sb.toString(); ... |
String | commaSeparatedString(List comma Separated String String mainString = ""; for (String string : strings) mainString += "," + string; mainString.replaceFirst(",", ""); return mainString; |
List | commaSeparatedStringToList(String csvListStr) comma Separated String To List List<String> list = new ArrayList<String>(); if (csvListStr != null && csvListStr.trim().length() > 0) { String[] ignoreListArr = csvListStr.split(","); for (int i = 0; i < ignoreListArr.length; i++) { list.add(ignoreListArr[i]); return list; ... |
List | commaSeparatedToList(String str) comma Separated To List if (str == null) { return new ArrayList<>(); return Arrays.asList(str.split("\\s*,\\s*")); |
List | commaSeperatedStringToList(String strValue) comma Seperated String To List if (strValue != null && !strValue.isEmpty()) { return Arrays.asList(strValue.split("\\s*,\\s*")); return new ArrayList<>(); |
List | commaSepLineToList(String commSepLine) Comma sep line to list. List<String> retList = null; if (commSepLine != null) { String[] calls = commSepLine.split(","); if (calls != null) { retList = new ArrayList<String>(); for (String call : calls) { retList.add(call.trim()); return retList; |
List | commaStringToList(String inputString) comma String To List return Arrays.asList(inputString.split("\\s*,\\s*")); |
List | convertCommaDelimitedStringToList(String s) convert Comma Delimited String To List List result = null; if (s != null) { result = new ArrayList(); String[] valueArray = s.split(","); for (int i = 0; i < valueArray.length; i++) { String value = valueArray[i]; if (value != null) { value = value.trim(); ... |
String | ConvertDiscussionGroupListToCommaString(List Convert Discussion Group List To Comma String String s = ""; if (list != null) { for (Long l : list) { if (s.length() > 0) s += ","; s += "" + l; return s; |
List | convertToStringList(String valuesCommaSeparated) Convert a String List. List<String> stringValues = new ArrayList<>(); if (valuesCommaSeparated != null) { for (String value : valuesCommaSeparated.split(",")) { if (!isBlank(value)) { stringValues.add(value); return stringValues; |