StrUtils.StringReplaceBoyerMoore returned wrong result
Original Reporter info from Mantis: tomitomy
-
Reporter name:
Original Reporter info from Mantis: tomitomy
- Reporter name:
Description:
StrUtils.StringReplaceBoyerMoore will get wrong result if use [rfIgnoreCase] option.
Steps to reproduce:
In the code below, Button1 will get correct result, but Button2 doesn't:
------------------------------
uses
StrUtils;
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Text := ' 空 空 空 空 空 空 空 空';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo2.Text := StrUtils.StringReplace(Memo1.Text, ' ', '', [rfReplaceAll], sraBoyerMoore);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Memo2.Text := StrUtils.StringReplace(Memo1.Text, ' ', '', [rfReplaceAll, rfIgnoreCase], sraBoyerMoore);
end;
------------------------------
Mantis conversion info:
- Mantis ID: 32770
- OS: Linux Mint MATE 64-Bit
- OS Build: 18.2
- Build: SVN 56537M
- Platform: Linux