String.StartsWith_

Syntax

StartsWith_(Source: String; SubStr: String): Boolean;

Parameters

Source. Source string.

SubStr. Search substring.

Description

The StartsWith_ method determines whether the beginning of source string contains search substring.

Comments

Available values:

Search for search substring in source string is case-sensitive. Spaces at the beginning of string and substring are ignored.

Example

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:

String