System.SysUtils.TStringHelper.Contains
Delphi
function Contains(const Value: string): Boolean; overload; inline;
function Contains(const Value: string; IgnoreCase: Boolean): Boolean; overload;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.SysUtils.pas | System.SysUtils | TStringHelper |
Description
Returns whether this string contains the given string.
Contains returns True if the string contains the string given through the Value parameter, False otherwise.
IgnoreCase specifies whether to use case-sensitivity or not.
var
MyString, ContainedString: String;
begin
MyString := 'This is a string.';
ContainedString := 'This';
Writeln(Boolean(MyString.Contains(ContainedString)));
end.
Output:
TRUE