Here you can find the source of joinWordList(List
public static String joinWordList(List<String> wordList, String delimiter)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static String joinWordList(List<String> wordList, String delimiter) { if (wordList.size() == 0) { return null; }/*from w ww . j ava2 s . c o m*/ StringBuffer sb = new StringBuffer(); for (String e : wordList) { if (sb.length() > 0) { sb.append(delimiter); } sb.append(e); } return sb.toString(); } }