Java Collection to String listToString(Collection collection)

Here you can find the source of listToString(Collection collection)

Description

list To String

License

LGPL

Declaration

public static String listToString(Collection<? extends Object> collection) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static String listToString(Collection<? extends Object> collection) {
        StringBuilder out = new StringBuilder();
        out.append("[");
        for (Object o : collection) {
            out.append(String.format("%s ", o));
        }//ww w  .j  av a 2s.  c  o m
        out.append("]");
        return out.toString();
    }
}

Related

  1. convertStringCollectionToString(Collection collectionString, String delemeter)
  2. convertStringCollectionToString(Collection value, String separator)
  3. convertToString(Collection ss)
  4. convertToString(final Collection objects)
  5. listToString(Collection aList, String aDelimiter, boolean quoteEntries)
  6. listToString(Collection l, String delim)
  7. listToString(Collection objects)
  8. listToStringArray(Collection list)
  9. listToStringHelper(StringBuilder sb, String sep, Collection list)