RIGHT function

Syntax

RIGHT (string, n)

Description

Use the RIGHT function to extract a substring comprising the last n characters of a string. It is equivalent to the following substring extraction operation:

string [ length ]

If you use this function, you need not calculate the string length.

If string evaluates to the null value, null is returned. If n evaluates to the null value, the RIGHT function fails and the program terminates with a run-time error message.

Example

PRINT RIGHT("ABCDEFGH",3)

This is the program output:

FGH