[fpc-pascal] String.Split(const Separators: array of Char; Options: TStringSplitOptions)
Ondrej Pokorny
lazarus at kluug.net
Fri Sep 17 17:47:25 CEST 2021
On 17.09.2021 00:02, Michael Van Canneyt via fpc-pascal wrote:
> On Thu, 16 Sep 2021, Bart via fpc-pascal wrote:
>> Hi,
>>
>> I must be missing something obvious.
>> But given the following definition of the Split() helper function for
>> strings:
>>
>> Function Split(const Separators: array of Char; Options:
>> TStringSplitOptions): TStringArray; overload; (fpc 3.2.2)
>>
>> Why does this not compile:
>>
>> var
>> SA: TStringArray;
>> ...
>> SA := S.Split([#0..#32],TStringSplitOptions.ExcludeEmpty);
>
> You are passing not an array of char but a set of char.
Yes, I just add that a set of char would be handier but it cannot be
used since Unicode Delphi because Char=UnicodeChar.
Ondrej
More information about the fpc-pascal
mailing list