Java Collection Join join(Collection data)

Here you can find the source of join(Collection data)

Description

join

License

Open Source License

Declaration

public static String join(Collection<Character> data) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static String join(String[] strs) {
        return join(strs, ",");
    }//from   w  w w  . ja v  a  2 s. c om

    public static String join(String[] strs, String delim) {
        String rtn = "";

        for (String str : strs) {
            rtn += str + delim;
        }

        return rtn.replaceFirst(delim + "$", "");
    }

    public static String join(Collection<Character> data) {
        return join(data, ",");
    }

    public static String join(Collection<Character> data, String delim) {
        String rtn = "";

        for (Character chr : data) {
            rtn += chr + delim;
        }

        return rtn.replaceFirst(delim + "$", "");
    }
}

Related

  1. join(Collection strs)
  2. join(Collection toJoin, String joinBy)
  3. join(Collection tokens, String d)
  4. join(Collection values)
  5. join(Collection collection, String separator)
  6. join(Collection c, String separator)
  7. join(Collection args, String delimeter)
  8. join(Collection c)
  9. join(Collection c, String joinSymbol)