Java Collection Join join(Collection c, String separator)

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

Description

join

License

Open Source License

Declaration

public static String join(Collection c, String separator) 

Method Source Code

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

import java.util.*;

public class Main {
    public static String join(Collection c, String separator) {
        boolean was = false;
        String result = "";
        for (Object o : c) {
            if (was)
                result += separator;//from w  w w .j  a v a 2 s . co m
            result += o;
            was = true;
        }
        return result;
    }
}

Related

  1. join(CharSequence separator, Collection col)
  2. join(Collection c)
  3. join(Collection c, String d)
  4. join(Collection c, String delim)
  5. join(Collection c, String left, String right, String separator)
  6. join(Collection col, char sep)
  7. join(Collection coll, String separator)
  8. join(Collection collection)
  9. join(Collection collection, String separator)