System.SysUtils.TStringHelper.Contains

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Contains(const Value: string): Boolean;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

Returns whether this 0-based string contains the given string.

Contains returns True if the string contains the string given through the Value parameter, False otherwise. This function is case-sensitive.

var
  MyString, ContainedString: String;

begin
  MyString := 'This is a string.';
  ContainedString := 'This';
  Writeln(Boolean(MyString.Contains(ContainedString)));
end.

Output:

TRUE

See Also