Android List Join join(List list, String separator)

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

Description

join

Declaration

public static String join(List<String> list, String separator) 

Method Source Code

//package com.java2s;
import java.util.List;

public class Main {

    public static String join(List<String> list, String separator) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < list.size(); i++) {
            builder.append(list.get(i));
            if (i < list.size() - 1) {
                builder.append(separator);
            }/*from   ww w . j a  v a2 s.co m*/
        }
        return builder.toString();
    }
}

Related

  1. join(List list, String separator, boolean ignoreNull)
  2. join(List strList, String separator)
  3. join(List list, String separator)
  4. join(List list, String glue)
  5. join(List s, String delimiter)