List of utility methods to do Collection Join
String | join(String delimiter, Collection Create a string by concatenating the elements of a collection using a delimiter between each item return (items != null) ? join(delimiter, items.toArray(new String[items.size()])) : null; |
String | join(String delimiter, Collection join StringBuilder sb = new StringBuilder(stringCollection.size() * (16 + delimiter.length())); for (String str : stringCollection) { sb.append(str).append(delimiter); return sb.toString(); |
String | join(String delimiter, Collection Joins a collection of strings into one with the specified delimiter. if (strings.isEmpty()) { return ""; Iterator<String> i = strings.iterator(); StringBuilder sb = new StringBuilder(i.next()); while (i.hasNext()) { sb.append(delimiter); sb.append(i.next()); ... |
String | join(String delimiter, Collection Joins a provided collection of String -s via provided delimiter. if (values == null || values.isEmpty()) { return null; Iterator<String> valuesIterator = values.iterator(); StringBuilder result = new StringBuilder(); result.append(valuesIterator.next()); while (valuesIterator.hasNext()) { result.append(delimiter).append(valuesIterator.next()); ... |
String | join(String glue, Collection c) join StringBuilder buf = new StringBuilder(); for (Object o : c) { if (buf.length() > 0) buf.append(glue); buf.append(o.toString()); return buf.toString(); |
String | join(String glue, Collection pieces) Join a Collection of Strings together. return join(glue, pieces.iterator());
|
String | join(String glue, Collection extends Object> c) join StringBuilder buf = new StringBuilder(); for (Object o : c) { if (buf.length() > 0) { buf.append(glue); buf.append(o.toString()); return buf.toString(); ... |
String | join(String glue, Collection join StringBuilder b = new StringBuilder(); boolean first = true; for (String s : strings) { if (!first) { b.append(glue); first = false; b.append(s); ... |
String | join(String glue, Collection Produces a string that consists of the toString of each element in collection with the glue string separating each item
final StringBuilder sb = new StringBuilder(); String join = ""; for (final T item : items) { sb.append(join); join = glue; sb.append(item.toString()); return sb.toString(); ... |
String | join(String join_string, Collection c) join return join(join_string, c.toArray());
|