Java Utililty Methods Iterable Join

List of utility methods to do Iterable Join

Description

The list of methods to do Iterable Join are organized into topic(s).

Method

StringjoinStrings(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());
...
StringjoinWith(Iterable elements, String join)
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();