Android Collection Join join(CharSequence separator, Collection values)

Here you can find the source of join(CharSequence separator, Collection values)

Description

join

Declaration

public static String join(CharSequence separator,
            Collection<CharSequence> values) 

Method Source Code

//package com.java2s;
import java.util.Collection;

public class Main {
    public static String join(CharSequence separator,
            Collection<CharSequence> values) {
        StringBuffer sb = new StringBuffer();
        for (CharSequence value : values) {
            if (sb.length() > 0) {
                sb.append(separator);//from  w ww .  jav a 2  s.  co m
            }
            sb.append(value);
        }
        return sb.toString();
    }
}

Related

  1. join(Collection strings, String sep)
  2. join(Collection strings, String sep)
  3. join(final Collection strings, String delimeter)
  4. join(Collection collection, String delimiter)
  5. join(Collection s, String delimiter)
  6. join(Collection strings, String sep)
  7. write(Collection c, Object separator, Object prefix, Object postfix)