RIGHT

Action

Returns a specified number of characters from the right side of a string.

 

Syntax

RIGHT ("string", length)

 

Parameters

String

String expression from which the rightmost characters are returned.

Length

Numeric expression indicating how many characters to return. If 0, a zero-length string is returned. If greater than or equal to the number of characters in string, the entire string is returned. Specifying a negative value will cause Right to return the number of characters equal to the total length of the string minus the value specified.

Returns

The substring requested.

 

Example

$x = RIGHT(@USERID, 2)   ; get the last 2 chars of the userid