List of utility methods to do List to String Convert
String | listLongToString(List list -> String list:100,200,300 - > string:100,200,300 if (null == inputList || inputList.isEmpty()) { return ""; StringBuffer sb = new StringBuffer(); for (Long input : inputList) { sb.append(input); sb.append(COMMA); sb.setLength(sb.length() - 1); return sb.toString(); |
String | listStrToString(List list -> String list:100,200,300 - > string:100,200,300 if (null == inputList || inputList.isEmpty()) { return ""; StringBuffer sb = new StringBuffer(); for (String input : inputList) { sb.append(input); sb.append(COMMA); sb.setLength(sb.length() - 1); return sb.toString(); |
String | listToString(List list To String StringBuilder sb = new StringBuilder(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { if (i < list.size() - 1) { sb.append(list.get(i) + ","); } else { sb.append(list.get(i)); return sb.toString(); |
String | convertStringArrayToString( List convert String Array To String String value = ""; for (int i = 0; i < stringList.size(); i++) { String selectedItemValue = stringList.get(i); if (i != 0) { value += seperator + " "; value += selectedItemValue; return value; |
String | listToString(List list To String if (list == null || list.isEmpty()) { return ""; final StringBuilder builder = new StringBuilder(); boolean first = true; for (String s : list) { if (first) { first = false; ... |
String | getCommaDelimitedString(List Returns a comma delimited String from input list of strings. String output = ""; if (input != null && input.size() > 0) { for (String tag : input) { output += tag + ","; output = output.substring(0, output.length() - 1); output = output.replaceAll(" ", ""); return output; |