List of utility methods to do Collection Join
String | join(String joiner, Collection join if (strings == null) return null; StringBuffer buffer = new StringBuffer(); for (String string : strings) { if (buffer.length() > 0) { buffer.append(joiner); buffer.append(string); ... |
String | join(String sep, Collection objects) join if (objects == null) return ""; StringBuffer res = new StringBuffer(); int i = 0; for (Iterator iter = objects.iterator(); iter.hasNext();) { if (i > 0) res.append(sep); res.append(iter.next()); ... |
String | join(String sep, Collection> col) Returns string that contains of all elements of passed collection joined together StringBuilder sb = new StringBuilder(); for (Object val : col) { if (sb.length() > 0) sb.append(sep); sb.append(castString(val)); return sb.toString(); |
String | join(String sep, Collection> col) join StringBuilder sb = new StringBuilder(); for (Object val : col) { if (sb.length() > 0) sb.append(sep); sb.append(val != null ? val.toString() : "null"); return sb.toString(); |
String | join(String sep, Collection> parts) join StringBuilder sb = new StringBuilder(); String s = ""; for (Object o : parts) { sb.append(s); if (o != null) { sb.append(o); s = sep; ... |
String | join(String sep, Collection> values) Joins a list of strings (or objects that can be converted to string via Object.toString()) into a single string with fields separated by sep. if (sep == null) throw new IllegalArgumentException(); if (values == null) return null; if (values.isEmpty()) return ""; StringBuilder s = null; for (Object a : values) { ... |
String | join(String sep, Collection> values) Join collection into a single string, with a separator between. StringBuilder builder = new StringBuilder(); join(builder, sep, values); return builder.toString(); |
String | join(String sep, Collection join StringBuilder sb = new StringBuilder(); boolean first = true; for (String s : strings) { if (!first) { sb.append(sep); } else { first = false; sb.append(s); return sb.toString(); |
String | join(String sep, Collection Join the string collection into one single string by the separator. return join(strs, sep);
|
String | join(String separator, Collection c) Returns a string formed by the concatenation of string versions of the elements in a collection, separated by a given separator. StringBuffer buffer = new StringBuffer(); Iterator it = c.iterator(); if (it.hasNext()) buffer.append(it.next()); while (it.hasNext()) buffer.append(separator + it.next()); return buffer.toString(); |