Java Collection Concatenate concat(Collection c)

Here you can find the source of concat(Collection c)

Description

concat

License

Apache License

Declaration

private static String concat(Collection<String> c) 

Method Source Code

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

import java.util.Collection;

public class Main {
    private static String concat(Collection<String> c) {
        StringBuilder sb = new StringBuilder();
        for (String s : c) {
            if (sb.length() > 0) {
                sb.append(",");
            }/*from ww w . j  av a 2  s  .  c o  m*/
            sb.append(s);
        }
        return sb.toString();
    }
}

Related

  1. concat(boolean removeDuplicates, Collection firstCollection, Collection... collections)
  2. concat(Collection> classes, String separator)
  3. concat(Collection collection, String delimiter)
  4. concat(Collection items)
  5. concat(Collection parts, int start, String defaultText)
  6. concat(Collection pieces, String delim)
  7. concat(Collection a, Collection b)