String.StartsWith

Syntax

StartsWith(Value: String): Boolean;

Parameters

Value. Checked character sequence.

Description

The StartWith method checks if the current string starts with the string of characters passed by the Value parameter.

Comments

The method returns True if the string starts with the specified sequence, and otherwise it returns False.

Example

Sub UserProc;
Var
    s: String;
    b, b1: Boolean;
Begin
    s := "abcdefg";
    b := s.StartsWith("b");
    b1 := s.StartsWith("a");
End Sub UserProc;

After executing the example the "b" and "b1" variables contain False and True respectively because the current string starts with the "a" character.

See also:

String