Here you can find the source of listToString(List
public static String listToString(List<String> list, String expr)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { public static String listToString(List<String> list, String expr) { String strInfo = ""; if (list != null && list.size() > 0) { StringBuffer sf = new StringBuffer(); for (String str : list) { sf.append(str);/* ww w. j a va2 s .c o m*/ sf.append(expr); } strInfo = sf.substring(0, sf.length() - 1); } return strInfo; } }