pub fn csv_escape(s: &str) -> StringExpand description
Escape a string for CSV per RFC 4180. If the string contains comma, double quote, or newline, wrap in quotes and escape quotes.
ยงExamples
use perfgate_export::csv_escape;
assert_eq!(csv_escape("hello"), "hello");
assert_eq!(csv_escape("has,comma"), "\"has,comma\"");
assert_eq!(csv_escape("has\"quote"), "\"has\"\"quote\"");