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

Stringjoin(Iterable strings, String delimiter)
Joins a list strings into a single string.
StringBuilder r = new StringBuilder();
for (Iterator<String> i = strings.iterator(); i.hasNext();) {
    r.append(i.next());
    if (i.hasNext())
        r.append(delimiter);
return r.toString();
Stringjoin(Iterable strings, String separator)
join
StringBuilder builder = new StringBuilder();
if (strings != null) {
    Iterator<String> iter = strings.iterator();
    while (iter.hasNext()) {
        String part = iter.next();
        builder.append(part);
        if (iter.hasNext()) {
            builder.append(separator);
...
Stringjoin(Iterable array, String joiner)
Missing counterpart for String.split()
StringBuilder b = new StringBuilder();
Iterator<T> i = array.iterator();
boolean first = true;
while (i.hasNext()) {
    if (first)
        first = false;
    else
        b.append(joiner);
...
Stringjoin(Iterable coll, String sep)
join
Iterator<T> it = coll.iterator();
String ret = "";
while (it.hasNext()) {
    ret = ret + it.next();
    if (it.hasNext()) {
        ret = ret + sep;
return ret;
Stringjoin(Iterable coll, String sep)
join
Iterator<T> it = coll.iterator();
String ret = "";
while (it.hasNext()) {
    ret = ret + it.next();
    if (it.hasNext()) {
        ret = ret + sep;
return ret;
Stringjoin(Iterable coll, String sep)
join
Iterator<T> it = coll.iterator();
String ret = "";
while (it.hasNext()) {
    ret = ret + it.next();
    if (it.hasNext()) {
        ret = ret + sep;
return ret;
Stringjoin(Iterable coll, String separator)
Joins into a string an iterable collection of objects by using a separator.
if (coll == null)
    return "";
Iterator<T> it = coll.iterator();
if (!it.hasNext())
    return "";
StringBuilder sb = new StringBuilder(it.next().toString());
while (it.hasNext()) {
    if (!isBlank(separator)) {
...
Stringjoin(Iterable items, String delimiter)
join
Iterator<T> i = items.iterator();
if (!i.hasNext())
    return "";
StringBuilder sb = new StringBuilder();
sb.append(i.next());
while (i.hasNext()) {
    sb.append(delimiter);
    sb.append(i.next());
...
Stringjoin(Iterable iterable)
join
Iterator<T> iterator = iterable.iterator();
if (!iterator.hasNext()) {
    return "";
StringBuilder stringBuilder = new StringBuilder(iterator.next().toString());
while (iterator.hasNext()) {
    stringBuilder.append(",");
    stringBuilder.append(iterator.next().toString());
...
Stringjoin(Iterable parts, String delimiter)
Join a number of (string representations of) items to a single string using a delimiter
StringBuilder builder = new StringBuilder();
Iterator<T> iter = parts.iterator();
while (iter.hasNext()) {
    builder.append(iter.next().toString());
    if (!iter.hasNext()) {
        break;
    builder.append(delimiter);
...