Here you can find the source of sanitizeForCsv(String str)
Sanitizes the string for comma-separated values (CSV) file output.<br> We follow the definition described by RFC 4180:<br> http://tools.ietf.org/html/rfc4180
public static String sanitizeForCsv(String str)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j av a 2 s .co m*/ * Sanitizes the string for comma-separated values (CSV) file output.<br> * We follow the definition described by RFC 4180:<br> * {@link http://tools.ietf.org/html/rfc4180} */ public static String sanitizeForCsv(String str) { return "\"" + str.replace("\"", "\"\"") + "\""; } }