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

silvioprog silvioprog at gmail.com
Tue Mar 8 15:36:47 CET 2016


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?

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160308/cadca677/attachment.html>


More information about the fpc-pascal mailing list