List of utility methods to do Collection Join
String | join(Collection> s) Concatenate a Collection of Strings using the given delimiter. if (s == null) return ""; StringBuilder buffer = new StringBuilder(); Iterator<?> iter = s.iterator(); while (iter.hasNext()) { Object item = iter.next(); if (item != null) { buffer.append(item); ... |
String | join(Collection> s, String delimiter) Given a collection of stuff, joins their string representation into one string using delimiter StringBuilder builder = new StringBuilder(); Iterator<?> iter = s.iterator(); while (iter.hasNext()) { builder.append(iter.next()); if (!iter.hasNext()) { break; builder.append(delimiter); ... |
String | join(Collection> s, String delimiter) Join a string array or list with a delimiter. StringBuilder builder = new StringBuilder(); Iterator<?> iterator = s.iterator(); while (iterator.hasNext()) { builder.append(iterator.next()); if (!iterator.hasNext()) { break; builder.append(delimiter); ... |
String | join(Collection> s, String delimiter) join return join(s, delimiter, null);
|
String | join(Collection> strings, String delimiter) join StringBuilder sb = new StringBuilder(); for (Object string : strings) { if (string == null) { string = ""; if (sb.length() > 0) { sb.append(delimiter).append(string.toString()); } else { ... |
String | join(Collection> strings, String delimiter) Implements join StringBuffer buffer = new StringBuffer(); Iterator<?> iter = strings.iterator(); if (iter.hasNext()) { buffer.append(iter.next().toString()); while (iter.hasNext()) { buffer.append(delimiter); buffer.append(iter.next().toString()); return buffer.toString(); |
String | join(Collection> strings, String separator) Concatenate multiple strings by inserting a separator. StringBuilder buf = new StringBuilder(); boolean first = true; for (Object s : strings) { if (first) first = false; else buf.append(separator); buf.append(s); ... |
String | join(Collection> strings, String separator) Concatenate multiple strings by inserting a separator. StringBuilder buf = new StringBuilder(); boolean first = true; for (Object s : strings) { if (first) { first = false; } else { buf.append(separator); buf.append(s); return buf.toString(); |
String | join(Collection> strings, String separator) Concatenate multiple strings by inserting a separator. StringBuilder buf = new StringBuilder(); boolean first = true; for (Object s : strings) { if (first) first = false; else buf.append(separator); buf.append(s); ... |
String | join(Collection> strs) join StringBuilder sb = new StringBuilder(); for (Object str : strs) { sb.append(str); return sb.toString(); |