Here you can find the source of join(List extends CharSequence> items, CharSequence delimiter)
public static String join(List<? extends CharSequence> items, CharSequence delimiter)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(List<? extends CharSequence> items, CharSequence delimiter) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < items.size(); i++) { if (i != 0) sb.append(delimiter);/* www .ja v a 2 s .co m*/ sb.append(items.get(i)); } return sb.toString(); } }