List of utility methods to do Collection Join
String | join(Collection> toJoin, String joinBy) join if (toJoin == null) { return null; String joined = ""; for (Object o : toJoin) { joined += o.toString() + joinBy; if (joined.length() > 0) { ... |
String | join(Collection> tokens, String d) Join the specified tokens into a delimited string. if (tokens == null) return null; return join(tokens, d, new StringBuilder()).toString(); |
String | join(Collection> values) Joins a collection of objects' toString() values into a single string, using the default delimiter of ", " (comma-space). if (values == null) return null; return join(values.toArray(new Object[values.size()])); |
String | join(Collection collection, String separator) Joins the elements in an input collection using a given separator. if (collection.isEmpty()) return ""; Iterator<A> it = collection.iterator(); StringBuilder out = new StringBuilder(); out.append(it.next()); while (it.hasNext()) out.append(separator).append(it.next()); return out.toString(); ... |
String | join(Collection join return join(data, ","); |
String | join(Collection returns a string with elements of the given collection concatenated, separated by given separator if (c.size() == 0) return ""; int n = c.size(), count = 0; StringBuilder result = new StringBuilder(); for (E e : c) { result.append(e); count++; if (count < n) ... |
String | join(Collection join StringBuilder sb = new StringBuilder(); Iterator<String> i = args.iterator(); while (i.hasNext()) { String s = i.next(); sb.append(s); if (i.hasNext()) sb.append(delimeter); return sb.toString(); |
String | join(Collection join return join(c, " "); |
String | join(Collection join StringBuffer sb = new StringBuffer(""); if (c != null) { for (String text : c) { sb.append(text).append(joinSymbol); int sblen = sb.length(); int symlen = joinSymbol.length(); if (sblen > symlen) { ... |
String | join(Collection Returns the comma seprated string example:-a@b.com,c@d.com,d@e.com if (coll.isEmpty()) return ""; StringBuilder sb = new StringBuilder(); for (String x : coll) sb.append(x + delimiter); sb.delete(sb.length() - delimiter.length(), sb.length()); return sb.toString(); |