Android Utililty Methods Collection Join

List of utility methods to do Collection Join

Description

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

Method

Stringjoin(CharSequence separator, Collection values)
join
StringBuffer sb = new StringBuffer();
for (CharSequence value : values) {
    if (sb.length() > 0) {
        sb.append(separator);
    sb.append(value);
return sb.toString();
...
Stringjoin(Collection strings, String sep)
Join a collection of strings by a seperator
return join(strings.iterator(), sep);
Stringwrite(Collection c, Object separator, Object prefix, Object postfix)
write
StringBuilder sb = new StringBuilder();
boolean first = true;
for (Object o : c) {
    if (!first)
        sb.append(separator);
    sb.append(prefix).append(o).append(postfix);
    first = false;
return sb.toString();