procedure SplitString(const S: Substring; const Delimiters: string; const List: TSubstringList); overload;
Splits S into List at every character of Delimiters, the empty parts included.
| # | Name | Description |
|---|---|---|
| 1 | S | The text; it may be an item of List. |
| 2 | Delimiters | The delimiter characters, every text kind. |
| 3 | List | The list the parts are written into, cleared first; an empty S gives no part. |
Result: stored in self (calling object)
Remarks:
S.Split with Delimiters' characters. An embedded #0 is a character, a delimiter only when Delimiters holds it.
Examples
Parts at any of two delimiters.
uses Substr;
procedure Example;
var List: TSubstringList;
begin
List := TSubstringList.Create(8);
try
SplitString(Substring('a;b,c'), ',;', List);
Assert(List.Count = 3);
Assert(List[1] = 'b');
finally
List.Free;
end;
end;