Here you can find the source of csvFormat(Object... obj)
public static String csvFormat(Object... obj)
//package com.java2s; /**/*from w w w.j a v a 2 s .c o m*/ * Various utilities. All methods here are static. * * @author Gregory Golberg (grisha@alum.mit.edu) * * Copyright ? <a href="http://www.enremmeta.com">Enremmeta LLC</a> * 2014. All Rights Reserved. This code is licensed under <a * href="http://www.gnu.org/licenses/agpl-3.0.html">Alfero GPL 3.0</a> * */ public class Main { public static String csvFormat(Object... obj) { String retval = ""; for (Object o : obj) { if (retval.length() > 0) { retval += ","; } if (o == null) { o = ""; } String s = o.toString(); s = s.replaceAll("\\\\", "\\\\\\\\"); s = s.replaceAll("\"", "\\\""); retval += "\"" + s + "\""; } return retval; } }