Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TStrings.CommaText

Contents of the list as a comma-separated string.

Declaration

Source position: classesh.inc line 1056

public property TStrings.CommaText : string
  read GetCommaText
  write SetCommaText;

Description

CommaText represents the stringlist as a single string, consisting of a comma-separated concatenation of the strings in the list. If one of the strings contains spaces, comma's or quotes it will be enclosed by double quotes. Any double quotes in a string will be doubled. For instance the following strings:

Comma,string
Quote"string
Space string
NormalSttring

is converted to

"Comma,string","Quote""String","Space string",NormalString

Conversely, when setting the CommaText property, the text will be parsed according to the rules outlined above, and the strings will be set accordingly. Note that spaces will in this context be regarded as string separators, unless the string as a whole is contained in double quotes. Spaces that occur next to a delimiter will be ignored. The following string:

"Comma,string" , "Quote""String",Space string,, NormalString

Will be converted to

Comma,String
Quote"String
Space
String

NormalString

This is a special case of the TStrings.DelimitedText property where the quote character is always the double quote, and the delimiter is always the colon.

Setting CommaText is equivalent to clearing the stringlist and calling TStrings.AddCommaText.

See also

TStrings.Text

  

Contents of the list as one big string.

TStrings.SetText

  

Set the contents of the list from a PChar.

TStrings.DelimitedText

  

Get or set all strings in the list in a delimited form.

TStrings.AddCommaText

  

Adds a comma-separated list of strings.


Documentation generated on: Oct 27 2024