SplitString doesn't work with two delimiters
Summary
SplitString doesn't work with two delimiters.
System Information
- Operating system: Windows 8.1
- Processor architecture: x86-64
- Compiler version: 3.3.1-9600-g03ce2324 [2021/11/10] for x86_64
- Device: Computer
Example Project
program Project1;
{$mode objfpc}{$H+}
uses
Types,
StrUtils,
SysUtils;
procedure RunTest;
var
I: Integer;
VStr: string;
VArr: TStringDynArray;
begin
VStr := '1-2; 3-4';
VArr := SplitString(VStr, '-;');
for I := 0 to Length(VArr) - 1 do begin
Writeln(I, ': ', VArr[I]);
end;
end;
begin
RunTest;
Readln;
end.
What is the current bug behavior?
Prints input string as is:
0: 1-2; 3-4
What is the expected (correct) behavior?
I expect 4 strings:
0: 1
1: 2
2: 3
3: 4