QuoteChar
property QuoteChar: Char read write;
Example
procedure ConfigureQuotedFields(const Items: TStringList);
begin
Items.QuoteChar := '"';
Items.Delimiter := ',';
end;
Usage
QuoteChar specifies the single quote character used to escape fields in DelimitedText and defaults to a double quote.
- Use a non-null character that the external format defines.
- Do not assume backslash escaping; embedded quote characters are doubled.
- Changing QuoteChar does not reparse existing values until DelimitedText is assigned.
Additional Technical Info
QuoteChar is declared by hidden ancestor TStrings and is normally used through a concrete visible descendant such as TStringList. It affects delimited formatting only and does not alter stored strings.
Source-backed behaviour
TStrings.Create initializes QuoteChar to ". During DelimitedText output, fields requiring quotes are wrapped and embedded quote characters are doubled. During input, a field beginning with QuoteChar is parsed with Delphi's quoted-string routine.
Setting #0 disables quoting in the getter and quoted-field recognition in the setter. That can make delimiter-containing, quote-containing or empty values fail to round-trip distinctly. CommaText temporarily uses double quote and restores this value.
Related members
DelimitedText implements quoting. CommaText fixes this setting temporarily.