Java List Join join(final List list, final CharSequence delim)

Here you can find the source of join(final List list, final CharSequence delim)

Description

join

License

Open Source License

Declaration

public static <E> String join(final List<? extends E> list, final CharSequence delim) 

Method Source Code

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

import java.util.List;

public class Main {
    public static <E> String join(final List<? extends E> list, final CharSequence delim) {
        final StringBuffer b = new StringBuffer();
        boolean skip = true;
        for (final E e : list) {
            if (skip) {
                skip = false;/*from   w w  w  .  j a  v  a 2s  . c o m*/
            } else {
                b.append(delim);
            }
            b.append(e);
        }
        return b.toString();
    }
}

Related

  1. join(Collection stringList, String seperator)
  2. join(Collection list, String delimiter)
  3. join(Collection list, String seperator)
  4. join(final List list, final String conjunction)
  5. join(final List toJoin)
  6. join(final List args)
  7. join(final List list, final String separator)
  8. join(final List things, final String on)
  9. join(final List list, final String delimiter)

    HOME | Copyright © www.java2s.com 2016