String.Contains

Syntax

Contains(Source: String, SubStr: String): Boolean;

Parameters

Source. Source string.

SubStr. Search substring.

Description

The Contains method determines whether source string contains search substring.

Comments

Available values:

Search for search substring in source string is case-sensitive.

Example

Sub UserProc;
Var
    s1, s2: String;
    b: Boolean;
Begin
    s1 := 
"Calculator";
    s2 := 
"Calc";
    
// Check if source string contains substring
    b := String.Contains(s1, s2);
    Debug.WriteLine(
"Contains(""" + s1 + "; " + s2 + """) = " + b.ToString);
End Sub UserProc;

After executing the example it is determined whether the Calculator string contains the Calc substring, and the result is displayed in the console window.

See also:

String