List of utility methods to do Collection Join
String | join(Collection c, String left, String right, String separator) Return a String object join all String object in param c, and add param left and param right to every String object on the left side and right side, separaing with param separator. if (c == null || c.size() == 0) { return null; StringBuffer sb = new StringBuffer(); boolean firstFlag = true; for (Iterator it = c.iterator(); it.hasNext();) { if (firstFlag) { firstFlag = false; ... |
String | join(Collection c, String separator) join boolean was = false; String result = ""; for (Object o : c) { if (was) result += separator; result += o; was = true; return result; |
String | join(Collection col, char sep) Join the String representations of a collection of objects, with the specified separator. if (col.isEmpty()) { return ""; StringBuffer buffer = new StringBuffer(); boolean first = true; for (Object o : col) { if (first) { first = false; ... |
String | join(Collection coll, String separator) join StringBuilder sb = new StringBuilder(); for (Iterator it = coll.iterator();;) { sb.append(it.next().toString()); if (it.hasNext()) { sb.append(separator); } else { break; return sb.toString(); |
String | join(Collection collection) This method joins each value in the collection with a tab character as the delimiter. return join(collection, "\t"); |
String | join(Collection collection, String separator) Join an collection of objects with a separator that appears after every instance in the list -including at the end return join(collection, separator, true);
|
String | join(Collection collection, String separator) Joins the elements of the provided if (collection == null) { return null; if (collection.isEmpty()) { return ""; final Iterator iterator = collection.iterator(); final Object first = iterator.next(); ... |
String | join(Collection collection, String separator) Joins the elements of the provided No delimiter is added before or after the list. if (collection == null) { return null; return join(collection.iterator(), separator); |
String | join(Collection collection, String separator) join if (collection == null) { return null; StringBuffer buffer = new StringBuffer(); for (Iterator iterator = collection.iterator(); iterator.hasNext(); buffer .append(iterator.next().toString())) { if (buffer.length() != 0) { buffer.append(separator); ... |
String | join(Collection collection, String separator, boolean trailing) join StringBuilder b = new StringBuilder(); collection.stream().forEach((o) -> b.append(o.toString()).append(separator)); return (trailing || b.length() == 0) ? b.toString() : (b.substring(0, b.length() - 1)); |