List of utility methods to do Collection Join
String | join(Collection Joins the list members into a delimiter separated String. StringBuilder sb = new StringBuilder(); int index = 0; for (T line : list) { sb.append(line); if (list.size() != index + 1) { sb.append(delimiter); index++; ... |
String | join(Collection join StringBuffer buffer = new StringBuffer(); Iterator<T> iter = s.iterator(); while (iter.hasNext()) { buffer.append(iter.next()); if (iter.hasNext()) { buffer.append(delimiter); return buffer.toString(); |
String | join(Collection join return join(things.toArray(), delim);
|
String | join(Collection join StringBuilder result = new StringBuilder(); String delim = ""; for (T value : values) { result.append(delim); result.append(value == null ? "null" : value.toString()); delim = join; return result.toString(); ... |
String | join(final char _separator, final boolean _quotes, final Collection A list of string is joined to one string. final StringBuilder ret = new StringBuilder(); boolean first = true; if (_list.isEmpty()) { if (_emptyString != null) { ret.append(_emptyString); } else { for (final String elem : _list) { ... |
String | join(final Collection collection, String delimiter) join if (collection == null || collection.size() == 0) { return EMPTY; final StringBuilder sb = new StringBuilder(collection.size() * 16); for (Object element : collection) { sb.append((String) element); sb.append(delimiter); return sb.toString().substring(0, sb.lastIndexOf(delimiter)); |
String | join(final Collection e, final String s) Join a collection as a string if (e == null || e.size() == 0) return ""; final StringBuilder builder = new StringBuilder(); for (final Object o : e) builder.append(o).append(s); final String r = builder.toString(); return r.substring(0, r.length() - s.length()); |
String | join(final Collection extends Object> items, final String glue) Implementation of join using a StringBuffer final StringBuffer buffer = new StringBuffer(); for (final Object o : items) { if (buffer.length() > 0) { buffer.append(glue); buffer.append(o.toString()); return buffer.toString(); ... |
String | join(final Collection> coll, final String delimiter) Join the Collection elements using the given delimiter. if (null == coll || coll.size() == 0) { return ""; StringBuffer buffer = new StringBuffer(); Iterator<?> iter = coll.iterator(); while (iter.hasNext()) { buffer.append(iter.next()); if (iter.hasNext()) { ... |
String | join(final Collection> coll, final String glue) join return join(coll.toArray(new Object[coll.size()]), glue); |