Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
type TSysCharSet = set of Char;
function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Integer;
Fills a string list with substrings parsed from a delimited list.
Separators is a set of characters that are used as delimiters, separating the substrings, where Carriage returns, newline characters, and quote characters (single or double) are always treated as separators. WhiteSpace is a set of characters to be ignored when parsing Content if they occur at the beginning of a string. Content is the null-terminated string to parse into substrings. Strings is a string list to which all substrings parsed from Content are added. The function returns the number of strings added to the Strings parameter.
//example 1 - requires TMemo named "Memo1"
ExtractStrings([';',','],
[' '],
'about: delphi; pascal, programming ',
memo1.Lines);
//would result in 3 strings added to memo:
//about: delphi
//pascal
//programming
//example 2
ExtractStrings([DateSeparator], [' '],
PChar(DateToStr(Now)), memo1.Lines);
//would result in 3 strings: day month and year of the currnet date
//for example '06', '25' ,'2003'
|
String Types in Delphi
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
Ordinal and Enumerated Data Types
Learn about Delphi's support for ordinal types. Extend Delphi's built-in types by constructing your own types.
LastDelimiter,
IsPathDelimiter
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|