String.StartsWith

Syntax

StartsWith(Value: String): Boolean;

Parameters

Value - checked character sequence.

Description

The StartWith method checks if the current string begins with the string of characters passed by the Value parameter. The method returns True if the string starts with the specified sequence, and otherwise it returns False.

Example

Sub Main;

Var

s: String;

b, b1: Boolean;

Begin

s := "abcdefg";

b := s.StartsWith("b");

b1 := s.StartsWith("a");

End Sub Main;

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

See also:

String