Here you can find the source of join(List list, String delimiter)
Parameter | Description |
---|---|
list | a parameter |
delimiter | a parameter |
public static String join(List list, String delimiter)
//package com.java2s; import java.util.List; public class Main { /**/* www .java 2 s.c om*/ * Joins elements in {@link List} with a delimiter {@link String} * * @param list * @param delimiter * @return */ public static String join(List list, String delimiter) { String out = ""; for (int i = 0; i < list.size(); i++) { out += list.get(i); if (i < list.size() - 1) { out += delimiter; } } return out; } }