Browse Source

Add case-sensitive TStringHelper.Contains for Delphi compatibility

Bi0T1N 2 weeks ago
parent
commit
4868b9d542
1 changed files with 6 additions and 2 deletions
  1. 6 2
      rtl/objpas/sysutils/syshelps.inc

+ 6 - 2
rtl/objpas/sysutils/syshelps.inc

@@ -419,7 +419,12 @@ begin
     end;
 end;
 
-function TStringHelper.Contains(const AValue: TStringType; IgnoreCase: Boolean): Boolean;
+function TStringHelper.Contains(const AValue: TStringType): Boolean; overload;
+begin
+    Result:=Pos(AValue,Self)>0;
+end;
+
+function TStringHelper.Contains(const AValue: TStringType; IgnoreCase: Boolean): Boolean; overload;
 begin
   if IgnoreCase then
     Result:=Pos(LowerCase(AValue),LowerCase(Self))>0
@@ -427,7 +432,6 @@ begin
     Result:=Pos(AValue,Self)>0;
 end;
 
-
 function TStringHelper.CountChar(const C: TStringChar): SizeInt;
 
 Var