Right function
Syntax
Right(str [, num_chars])
Description
Use the Right function to return a specified number of characters from the right side of a string. The function is useful if, for example, you want to get the last set of characters in a zip code or other fixed-length identification string. If the string contains Unicode non-BMP characters, each code unit of the surrogate pair is counted as a separate character and care should be taken not to split the surrogate pair.
Parameters
| Parameter | Description |
|---|---|
|
str |
A String value from which you want to get the rightmost characters. |
|
num_chars |
A Number value, greater than or equal to zero. If num_chars is omitted it is assumed to be equal to 1. |
Returns
Returns a String value equal to the rightmost num_chars character(s) in str.
Example
If &ZIP is equal to "90210-4455", the following example sets &SUFFIX to "4455":
&SUFFIX = Right(&ZIP, 4)
Related Topics