Java Collection to String CollectionToStr(Collection coll)

Here you can find the source of CollectionToStr(Collection coll)

Description

Collection To Str

License

Open Source License

Declaration

public static String CollectionToStr(Collection<String> coll) 

Method Source Code

//package com.java2s;

import java.util.Collection;

public class Main {
    public static String CollectionToStr(Collection<String> coll) {
        StringBuffer sb = new StringBuffer();
        int i = 0;
        for (String string : coll) {
            if (i > 0) {
                sb.append(",");
            }/*from   w w w. j  a v  a2  s . c o m*/
            i++;
            sb.append(string);
        }
        return sb.toString();
    }
}

Related

  1. collectionToDelimitedString(Collection coll, String delim)
  2. collectionToDelimitedString(Collection coll, String delim)
  3. collectionToDelimitedString(Collection coll, String delim, String prefix, String suffix)
  4. collectionToDelimitedString(Collection values, String delimiter)
  5. collectionToStr(Collection collection)
  6. collectionToStr(Collection collection)
  7. collectionToString( Collection collection)
  8. collectionToString(@SuppressWarnings("rawtypes") Collection coll)
  9. collectionToString(Collection c)