Java List Join join(List list, String separator)

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

Description

join

License

Open Source License

Declaration

public static String join(List<Integer> list, 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(List<Integer> list, String separator) {
        if (list == null || list.isEmpty())
            return null;
        StringBuilder sBuilder = new StringBuilder();
        for (Integer item : list) {
            if (item != null)
                sBuilder.append("," + item.toString());
        }/*w  w  w .j  a v a2s .c  om*/
        sBuilder.deleteCharAt(0);
        return sBuilder.toString();
    }
}

Related

  1. join(List parts)
  2. join(List resultList, String sep)
  3. join(List strings, String delimiter)
  4. join(List list1, List list2)
  5. join(List array, char c)
  6. join(List recycled)
  7. join(List list)
  8. join(List list)
  9. join(List list, String delim)

    HOME | Copyright © www.java2s.com 2016