Here you can find the source of toCsv(List
public static String toCsv(List<String> strs)
//package com.java2s; /*/*from w w w . java2 s . co m*/ Copyright 2011 Northbranchlogic, Inc. This file is part of Parallel Processing with EC2 (ppe). ppe is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ppe is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ppe. If not, see <http://www.gnu.org/licenses/>. */ import java.util.*; public class Main { public static String toCsv(List<String> strs) { StringBuilder s = new StringBuilder(); for (int i = 0; i < strs.size() - 1; i++) { s.append(strs + ", "); } s.append(strs.get(strs.size() - 1)); return (s.toString()); } }