Left(Source: String; Count: Integer): String;
Source. String.
Count. Number of characters from the left edge of string.
The Left method returns the specified number of characters from the left edge of string.
To get characters from the right edge of string, use String.Right.
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: