Java Collection to String convertStringCollectionToString(Collection value, String separator)

Here you can find the source of convertStringCollectionToString(Collection value, String separator)

Description

convert String Collection To String

License

Open Source License

Declaration

public static String convertStringCollectionToString(Collection<String> value, String separator) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    public static String convertStringCollectionToString(Collection<String> value, String separator) {
        if (value.size() == 0) {
            return "";
        }/*w w w. j  av a 2 s .c  om*/
        StringBuilder sb = new StringBuilder();
        for (String v : value) {
            sb.append(v);
            sb.append(separator);
        }
        sb.setLength(sb.length() - separator.length());
        return sb.toString();
    }
}

Related

  1. convertCollectionToString(Collection coll, String delimiter)
  2. convertEnumsToString(Collection> enums)
  3. convertListToString(Collection list)
  4. convertString(Collection strings)
  5. convertStringCollectionToString(Collection collectionString, String delemeter)
  6. convertToString(Collection ss)
  7. convertToString(final Collection objects)
  8. listToString(Collection aList, String aDelimiter, boolean quoteEntries)
  9. listToString(Collection collection)