String.Right

Syntax

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

Parameters

Source. String.

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

Description

The Right method returns the specified number of characters from the right edge of string.

Comments

To get characters from the left edge of string, use the String.Left method.

Example

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

After executing the example first four characters from the right edge of the Calculator string are displayed in the console window.

See also:

String