csvquoted(
TEXT
)

The csvquoted( function adds quotes if necessary for CSV text (RFC 4180).


Parameters

This function has one parameter:

text – the original text.


Description

This function can assist with exporting CSV text (see RFC 4180). If the text contains a comma, double quote ("), carriage return or linefeed, it is surrounded with double quotes, and any double quotes within the text are turned into 2 double quotes. Otherwise, the text is left alone.

csvquoted({David Smith}) ☞ David Smith
csvquoted({Smith, David}) ☞ "Smith, David"
csvquoted({John said "It's ready!"}) ☞ "John said ""It's ready!"""

See Also


History

VersionStatusNotes
10.0NewNew in this version.