Here you can find the source of listToString(List
public static String listToString(List<String> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String listToString(List<String> list) { if (list == null || list.size() == 0) { return ""; }/*from www . j av a 2 s .c o m*/ String temp = list.toString(); return temp.substring(1, temp.length() - 1); } }