Java List Join join(List elements)

Here you can find the source of join(List elements)

Description

join

License

Open Source License

Declaration

public static String join(List<String> elements) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String join(List<String> elements) {
        if (elements.isEmpty())
            return "[]";
        StringBuilder ret = new StringBuilder();
        for (String element : elements)
            ret.append(", ").append(element);
        return "[" + ret.substring(2) + "]";
    }/*from  w  ww  .j  a v a 2 s .  c o m*/
}

Related

  1. join(List args, String connector)
  2. join(List args, String seperator)
  3. join(List array, String delim)
  4. join(List c, String seperator)
  5. join(List command, List args)
  6. join(List items, char separator)
  7. join(List l, String joiner)
  8. join(List lines, char delim)
  9. join(List list)