Skip to main content

CommaText

property CommaText: string read write;

Example

procedure ParseCommaValues(const Items: TStringList);
begin
Items.CommaText := 'Alpha,"Beta, Inc.",""';
end;

Usage

CommaText gets or replaces all strings using comma delimiters and double-quote escaping while preserving the configured delimiter and quote settings.

  • Do not treat this as an RFC-defined multi-record CSV reader: it represents one list record and has no row/header/schema model.
  • Set StrictDelimiter deliberately before parsing significant whitespace.
  • Assignment is destructive and not rollback-safe after the old entries are cleared.

Additional Technical Info

CommaText is declared by hidden ancestor TStrings and is normally used through a concrete visible descendant such as TStringList. It is a convenience view over DelimitedText, not a complete CSV file parser.

Source-backed behaviour

For either read or write, the RTL saves current Delimiter and QuoteChar, temporarily sets them to comma and double quote, delegates to DelimitedText, and restores both in finally. StrictDelimiter is not changed, so its current value still controls whitespace treatment.

The getter quotes fields containing delimiter, quote or—when strict mode is false—characters #1 through space, and doubles embedded quote characters. One empty entry becomes ""; an empty list becomes an empty string. The setter clears and reparses the list, including trailing/repeated comma empty fields.

DelimitedText uses configurable characters. Text is line-oriented. Strings accesses the parsed fields.

Official RTL references

Created 2026-07-15