List of utility methods to do Collection Convert
String | toCommaSep(Collection to Comma Sep if (strings.isEmpty()) { return "&bNone"; StringBuilder sb = new StringBuilder(); strings.forEach(s -> sb.append("&3").append(s).append("&7, ")); return sb.delete(sb.length() - 2, sb.length()).toString(); |
String | toCommaSeparatedString(final Collection extends Object> items) Returns string containing item names, each separated from other with comma and space. String result = ""; for (final Iterator<? extends Object> iter = items.iterator(); iter.hasNext();) { result += iter.next(); if (iter.hasNext()) { result += COMMA_SPACE_SEPARATOR; return result; ... |
String | toCommaSeparatedValues(Collection> list) to Comma Separated Values StringBuilder csv = new StringBuilder(); if (list != null) { Object[] array = list.toArray(new Object[list.size()]); for (int i = 0; i < list.size(); i++) { if (i > 0) { csv.append(","); if (array[i] != null) { ... |
String | toCommaSepared(Collection to Comma Separed String res = ""; if (isNotEmpty(aListOfString)) { res = aListOfString.toString(); return res; |
String | toCommaString(Collection to Comma String String commaStr = ""; for (String str : c) { commaStr = commaStr + str + ","; commaStr = commaStr.substring(0, commaStr.length() - 1); return commaStr; |
String | toCsvString(Collection Constructs a single String by iterating over the elements in the collection parameter, calling toString() on each method. return toXsvString(collection, ", "); |
String | toCSVString(Collection Returns a csv string of the given values. if ((theCollection == null) || (theSeparator == null)) { return ""; StringBuffer sbReturn = new StringBuffer(); boolean isFurther = false; for (T theElement : theCollection) { if (isFurther) { sbReturn.append(theSeparator); ... |
String | toDelimitedList(Collection to Delimited List StringBuilder sb = new StringBuilder(); boolean first = true; for (T value : values) { if (first) { first = false; } else { sb.append(delimiter); sb.append(value); return sb.toString(); |
String | toDelimitedString(Collection c, String delimiter) to Delimited String if (c.isEmpty()) { return ""; StringBuffer result = new StringBuffer(); for (Iterator i = c.iterator(); i.hasNext();) { Object o = i.next(); result.append(delimiter + ((o == null) ? "" : o.toString())); return result.substring(delimiter.length()); |
String | toDelimitedString(Collection to Delimited String return toDelimitedString(coll, delim, "", ""); |