Java Collection Join join(CharSequence p, Collection collection)

Here you can find the source of join(CharSequence p, Collection collection)

Description

join

License

Apache License

Declaration

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

Method Source Code


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

import java.util.Collection;

public class Main {
    public static String join(CharSequence p, Collection<?> collection) {
        StringBuilder sb = new StringBuilder();
        boolean f = true;
        for (Object c : collection) {
            if (f)
                f = false;//from  w  w w  .ja  va2 s.c  o  m
            else
                sb.append(p);
            sb.append(c.toString());
        }
        return sb.toString();
    }
}

Related

  1. getNeoString(String columnName, String delimiter, Collection input, String join)
  2. implode(Collection items, String join)
  3. internalJoin(String sep, Collection pieces)
  4. isDisjoint(Collection a, Collection b)
  5. join(AbstractCollection s, String delimiter)
  6. join(CharSequence separator, Collection col)
  7. join(Collection c)
  8. join(Collection c, String d)
  9. join(Collection c, String delim)

  10. HOME | Copyright © www.java2s.com 2016