TStringHelper.Split() issue
Original Reporter info from Mantis: silvioprog
-
Reporter name: silvioprog
Original Reporter info from Mantis: silvioprog
- Reporter name: silvioprog
Description:
Hello,
Just test this code below:
program Project1; {$mode delphi} uses SysUtils; var content: string = 'x:y'; splited: TArray&LtPos;string>; begin splited := content.Split([':']); WriteLn(Length(splited)); ReadLn; end.
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".
Additional information:
It happens only when the second part of string has only one character, two or more (eg "content: string = 'x:yy'") it works.
Mantis conversion info:
- Mantis ID: 29798
- Fixed in version: 3.1.1
- Fixed in revision: 33209 (#839a0445)
- Target version: 3.0.2