StartsWith_(Source: String; SubStr: String): Boolean;
Source. Source string.
SubStr. Search substring.
The StartsWith_ method determines whether the beginning of source string contains search substring.
Available values:
True. Source string starts with search substring.
False. Source string does not start with search substring.
Search for search substring in source string is case-sensitive. Spaces at the beginning of string and substring are ignored.
Sub UserProc;
Var
s1, s2: String;
b: Boolean;
Begin
s1 := "Calculator";
s2 := "Calc";
// Check if the beginning of source string contains search substring
b := String.StartsWith_(s1, s2);
Debug.WriteLine("StartsWith_(""" + s1 + "; " + s2 + """) = " + b.ToString);
End Sub UserProc;
After executing the example it is determined whether the beginning of the Calculator string contains the Calc substring, and the result is displayed in the console window.
See also: