List of utility methods to do Collection Join
String | join(Collection> collection, String delimiter) Joins the elements of a collection together into one string. return join(collection, delimiter, "%s"); |
String | join(Collection> collection, String inputSeparator) Joins the elements of the provided collection into a single string containing the provided elements. if (collection == null) { return null; String actualSeparator = inputSeparator == null ? "" : inputSeparator; String separator = ""; StringBuilder result = new StringBuilder(); for (Object item : collection) { result.append(separator).append(item); ... |
String | join(Collection> collection, String join) Join the given collection with the given join value. StringBuilder builder = new StringBuilder(); for (Iterator<?> iter = collection.iterator(); iter.hasNext();) { builder.append(iter.next()); if (iter.hasNext()) { builder.append(join); return builder.toString(); ... |
String | join(Collection> collection, String sep) join StringBuilder s = new StringBuilder(); for (Object obj : collection) { if (s.length() > 0) { s.append(sep); if (obj == null) { s.append(""); } else { ... |
String | join(Collection> collection, String separator) Takes a collection and returns all elements assembled in a String joined by the defined separator. String output = ""; if (collection != null) { Iterator<?> iterator = collection.iterator(); while (iterator.hasNext()) { Object o = iterator.next(); output += o; if (iterator.hasNext()) output += separator; ... |
String | join(Collection> collection, String separator) join String s = ""; for (Object item : collection) { s += item.toString() + separator; return s.substring(0, s.length() - separator.length()); |
String | join(Collection> collection, String separator) join if (collection == null) { return null; Iterator<?> it = collection.iterator(); if (!it.hasNext()) { return ""; Object first = it.next(); ... |
String | join(Collection> collection, String separator) Takes a collection and returns all elements assembled in a String joined by the defined separator. String output = ""; if (collection != null) { Iterator<?> iterator = collection.iterator(); while (iterator.hasNext()) { Object o = iterator.next(); output += o; if (iterator.hasNext()) output += separator; ... |
String | join(Collection> collection, String separatorString) join if (collection == null) { return null; StringBuilder result = new StringBuilder(); Iterator<?> iterator = collection.iterator(); while (iterator.hasNext()) { Object next = iterator.next(); String strValue = (next != null) ? next.toString() : ""; ... |
String | join(Collection> elements, String separator) join if (elements == null || elements.isEmpty()) { return ""; StringBuilder builder = new StringBuilder(); Iterator<?> itr = elements.iterator(); while (itr.hasNext()) { builder.append(itr.next()); if (itr.hasNext()) { ... |