List of utility methods to do Iterable Join
String | joinStrings(Iterable> strs, String sep) join Strings StringBuilder b = new StringBuilder(""); Iterator<?> i = strs.iterator(); if (!i.hasNext()) return ""; b.append(i.next()); while (i.hasNext()) { b.append(sep); b.append(i.next()); ... |
String | joinWith(Iterable join With StringBuilder result = new StringBuilder(); Iterator<String> it = elements.iterator(); if (it.hasNext()) { result.append(it.next()); while (it.hasNext()) { result.append(join).append(it.next()); return result.toString(); |