Right - Built-in String Function¶
Purpose¶
The Right function returns a string containing a specified number of characters from the right side of the string.
Syntax¶
Right(str, int)
Arguments¶
| Argument | Required | Description |
|---|---|---|
str |
Yes | Any valid string expression from which the specified number of characters are returned. |
int |
Yes | Any valid integer expression. The number of characters returned. |
Returns¶
String
Example¶
Let sTest = "Hello World"
Return Right(sTest, 5) // returns "World"
See Also¶
Notes¶
- When
strorintcannot be converted to the specified type, a runtime error is generated. - If
intis 0 (or less), an empty string ("") is returned. If greater than or equal to the number of characters instr, the entire string is returned.