sysutils.TStringHelper.Contains and sysutils.TStringHelper.Equals should contain case-insensitive versions
Summary
TStringHelper.StartsWith and .EndsWith already contains case-insensitive versions. It would be helpful to have those also for .Equals and .Contains.
System Information
- Operating system: Windows
- Processor architecture: x86-64
- Device: Computer
Suggestion
function TStringHelper.Equals(const AValue: string; IgnoreCase: Boolean): Boolean;
begin
if IgnoreCase then
Result:=(CompareText(Self,AValue)=0)
else
Result:=(Self=AValue);
end;
function TStringHelper.Contains(const AValue: string; IgnoreCase: Boolean): Boolean;
begin
if IgnoreCase
then
Result:=Pos(LowerCase(AValue),LowerCase(Self))>0;
else
Result:=Pos(AValue,Self)>0;
end;