String.Left

Syntax

Left(Source: String; Count: Integer): String;

Parameters

Source. String.

Count. Number of characters from the left edge of string.

Description

The Left method returns the specified number of characters from the left edge of string.

Comments

To get characters from the right edge of string, use String.Right.

Example

Sub UserProc;
Var
    s1, s2: String;
    i: Integer;
Begin
    s1 := 
"Calculator";
    i := 
4;
    
// Get string characters
    s2 := String.Left(s1, i);
    Debug.WriteLine(
"Left(""" + s1 + "; " + i.ToString + """) = " + s2);
End Sub UserProc;

After executing the example the first four characters from the left edge of the Calculator string will be displayed in the console window.

See also:

String