Here you can find the source of listToStr(List
public static String listToStr(List<String> list)
//package com.java2s; import java.util.List; public class Main { public static String listToStr(List<String> list) { StringBuilder sb = new StringBuilder(); for (String s : list) { sb.append(s);//from w w w . ja va 2 s . com sb.append("\n"); } return sb.toString(); } }