Right

Use the Right function to return a specified number of characters from the right side of a string.

Syntax

The Right function returns a variant(string). To determine the number of characters in a string, use the Len function.

Right(string, length)

Argument Description
string String expression from which characters are returned. If string contains Null, then Null is returned.
length Variant (Long). Numeric expression indicating how many characters to return. If 0, then a zero-length string ("") is returned. If greater than or equal to the number of characters in string, then the entire string is returned.

To determine the number of characters in a string, use the Len function.

Use the RightB function with byte data contained in a string. Instead of specifying the number of characters to return, length specifies the number of bytes.

Example

This example returns "on the right":

Right("The characters on the right",12)