Java List Join join(String separator, List items)

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

Description

join

License

Open Source License

Declaration

public static String join(String separator, List<? extends Object> items) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String join(String separator, List<? extends Object> items) {
        return join(separator, items.toArray(new Object[items.size()]));
    }/*ww w. j  av  a2  s.  c  om*/

    public static <T> String join(String separator, T... items) {
        return join(separator, 0, items);
    }

    public static <T> String join(String separator, int offset, T... items) {
        StringBuffer buf = new StringBuffer();
        for (int i = offset; i < items.length; i++) {
            buf.append(items[i]);
            if (i < items.length - 1) {
                buf.append(separator);
            }
        }
        return buf.toString();
    }
}

Related

  1. join(String joinString, List strings)
  2. join(String joint, List elements)
  3. join(String sep, List a)
  4. join(String separator, Collection list)
  5. join(String separator, Collection inputList)
  6. join(String separator, List objs)
  7. join(String separator, List elements)
  8. join(String separator, List items)
  9. join(String separator, List parts)