[fpc-pascal] TStringHelper.Split() issue?

Michael Van Canneyt michael at freepascal.org
Tue Mar 8 16:03:59 CET 2016



On Tue, 8 Mar 2016, silvioprog wrote:

> Hello,
>
> Just test this code below:
>
> === code ===
>
> program Project1;
>
> {$mode delphi}
>
> uses
>  SysUtils;
>
> var
>  content: string = 'x:y';
>  splited: TArray<string>;
> begin
>  splited := content.Split([':']);
>  WriteLn(Length(splited));
>  ReadLn;
> end.
>
> === /code ===
>
> On FPC, it returns 1, on Delphi, it returns 2. And debuging the "splited"
> variable, on FPC I get only and "x" value, Delphi "x" and "y".
>
> Is this a bug?

Yes. Quite strange, because I have testcases for this ?

Michael.



More information about the fpc-pascal mailing list