List of utility methods to do Collection Join
String | join(CharSequence separator, Collection join StringBuffer sb = new StringBuffer(); for (CharSequence value : values) { if (sb.length() > 0) { sb.append(separator); sb.append(value); return sb.toString(); ... |
String | join(Collection strings, String sep) Join a collection of strings by a seperator return join(strings.iterator(), sep);
|
String | write(Collection> c, Object separator, Object prefix, Object postfix) write StringBuilder sb = new StringBuilder(); boolean first = true; for (Object o : c) { if (!first) sb.append(separator); sb.append(prefix).append(o).append(postfix); first = false; return sb.toString(); |