Here you can find the source of toCSV(double[] as)
public static String toCSV(double[] as)
//package com.java2s; //License from project: GNU General Public License import java.util.List; public class Main { public static String toCSV(double[] as) { StringBuilder b = new StringBuilder(); for (int i = 0; i < as.length - 1; i++) { b.append(as[i]);//from ww w .j ava 2s . com b.append(","); } b.append(as[as.length - 1]); return b.toString(); } public static String toCSV(List<String> as) { StringBuilder b = new StringBuilder(); for (int i = 0; i < as.size() - 1; i++) { b.append(as.get(i)); b.append(","); } b.append(as.get(as.size() - 1)); return b.toString(); } }