RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWideStrings.CommaText Property

Lists the strings in the TWideStrings object in system data format (SDF).

Pascal
property CommaText: WideString;
C++
__property BSTR CommaText;

Use CommaText to get or set all the strings in the TWideStrings object in a single comma-delimited string. 

When retrieving CommaText, any string in the list that include spaces, commas or quotes will be contained in double quotes, and any double quotes in a string will be repeated. For example, if the list contains the following strings:

Stri,ng 1
Stri"ng 2
String 3
String4

CommaText will return:

"Stri,ng 1","Stri""ng 2","String 3",String4

When assigning CommaText, the value is parsed as SDF formatted text. For SDF format, strings are separated by commas or spaces, and optionally enclosed in double quotes. Double quote marks that are part of the string are repeated to distinguish them from the quotes that surround the string. Spaces and commas that are not contained within double quote marks are delimiters. Two commas next to each other will indicate an empty string, but spaces that appear next to another delimiter are ignored. For example, suppose CommaText is set to:

"Stri,ng 1", "Stri""ng 2" , String 3,String4

The list will then contain:

Stri,ng 1
Stri"ng 2
String
3
String4

Note: CommaText is the same as the DelimitedText property with a delimiter of ',' and a quote character of '"'.
Including a trailing comma in the source string causes a blank item to be included in the string list. For example, if CommaText is set to

"String1, String 2, String 3,"

the string list will contain

String1
String2
String3
<Blank>

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!