Java Iterable commafy(Iterable col, StringBuilder builder)

Here you can find the source of commafy(Iterable col, StringBuilder builder)

Description

commafy

License

Apache License

Declaration

public static void commafy(Iterable col, StringBuilder builder) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Iterator;

public class Main {
    public static void commafy(Iterable col, StringBuilder builder) {
        for (Iterator itr = col.iterator(); itr.hasNext();) {
            Object obj = itr.next();
            builder.append(obj.toString());
            if (itr.hasNext()) {
                builder.append(", ");
            }//w w  w  .j  a  v  a2  s. co m
        }
    }
}

Related

  1. appendTo(StringBuilder appendable, Iterable parts, CharSequence separator)
  2. containsSame(Iterable coll, Object obj)
  3. convertIterable(final Iterable> iterables)
  4. createDelimitedString(Iterable iterable, String delimiter)
  5. createUpdateTemplate(String table, Iterable columns)