Here you can find the source of listOfStrToString(List
public static String listOfStrToString(List<String> src, String del)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String listOfStrToString(List<String> src, String del) { StringBuilder sb = new StringBuilder(); for (String s : src) sb.append(s + del);//from w w w. ja v a 2 s . com src.clear(); src = null; return sb.toString(); } public static String listOfStrToString(List<String> src, String del, boolean hasDelAtEdn) { StringBuilder sb = new StringBuilder(); for (String s : src) sb.append(s + del); if (!hasDelAtEdn) sb.setLength(sb.length() - del.length()); src.clear(); src = null; return sb.toString(); } }