Java List Join join(final List array, final String separator)

Here you can find the source of join(final List array, final String separator)

Description

join

License

Open Source License

Declaration

public static String join(final List<String> array, final String separator) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String join(final List<String> array, final String separator) {
        final StringBuilder buf = new StringBuilder(array.size() * 16);
        for (String str : array) {
            buf.append(str);//from   ww w . ja  v  a  2  s  .  c  om
            buf.append(separator);
        }
        buf.setLength(buf.length() - separator.length());
        return buf.toString();
    }
}

Related

  1. join(final List list, final CharSequence delim)
  2. join(final List args)
  3. join(final List list, final String separator)
  4. join(final List things, final String on)
  5. join(final List list, final String delimiter)
  6. join(final List data, String separator)
  7. join(final List list)
  8. join(final List list, final String sepa)
  9. join(final List path, final char delimiter)

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