Java List Join join(List list)

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

Description

join

License

Open Source License

Declaration

public static String join(List<String> list) 

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> list) {
        String rtn;/*w w w .  j av a  2 s  .c o  m*/
        if (list.isEmpty()) {
            rtn = "";
        } else {
            StringBuilder sb = new StringBuilder();
            for (String string : list) {
                sb.append(string).append(",");
            }
            rtn = sb.substring(0, sb.length() - 1);
        }
        return rtn;
    }
}

Related

  1. join(List items, char separator)
  2. join(List l, String joiner)
  3. join(List lines, char delim)
  4. join(List list)
  5. join(List list)
  6. join(List list)
  7. join(List list)
  8. join(List list)
  9. join(List list, String conjunction)