CSV Escape / Unescape

Escapes or unescapes a CSV string removing traces of offending characters that could prevent parsing.

The following rules are applied:

  • If a value contains a comma, a newline character or a double quote, then the string must be enclosed in double quotes. E.g: "Newline char in this field \n"
  • A double quote must be escaped with another double quote. E.g: "The double quote character "" is offensive."