Contains(Source: String, SubStr: String): Boolean;
Source. Source string.
SubStr. Search substring.
The Contains method determines whether source string contains search substring.
Available values:
True. Source string contains search substring.
False. Source string does not contain search substring.
Search for search substring in source string is case-sensitive.
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: