Java Collection Join join(Collection collection, String separator)

Here you can find the source of join(Collection collection, String separator)

Description

join

License

Open Source License

Declaration

public static String join(Collection<?> collection, String separator) 

Method Source Code

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

import java.util.Collection;

public class Main {

    public static String join(Collection<?> collection, String separator) {
        String s = "";
        for (Object item : collection) {
            s += item.toString() + separator;
        }/*from   w  ww.j  a v a  2  s .c  om*/
        return s.substring(0, s.length() - separator.length());
    }
}

Related

  1. join(Collection collection, String delimiter)
  2. join(Collection collection, String inputSeparator)
  3. join(Collection collection, String join)
  4. join(Collection collection, String sep)
  5. join(Collection collection, String separator)
  6. join(Collection collection, String separator)
  7. join(Collection collection, String separator)
  8. join(Collection collection, String separatorString)
  9. join(Collection elements, String separator)