RIGHT(string, length)
RIGHTB(string, length)
Description
RIGHT returns a string containing a number of characters from the right end of a string. The required parameter, string, is any valid string expression. The required parameter, length, is any valid numeric expression, if length is 0, an empty string ("") is returned, if length is greater than the size of string, the entire string is returned.
RIGHTB is a strict bytewise version of RIGHT. When used on the Unicode strings of Windows CE devices, it will return any partial character as a normal character.
Example
REM RIGHT Example
'RIGHT returnssubstringfromstringrightend
DIM Wendy, Eric
Wendy = "Testaburger"
Eric = "Cartman"
PRINT "The RIGHT 6 of " & Wendy & ":", _
RIGHT(Wendy, 6)
PRINT "The RIGHT 4 of " & Eric & ":", _
RIGHT(Eric, 4)
Output
The RIGHT 6 of Testaburger:burger
The RIGHT 4 of Cartman: tman
Related Items
LEFT, MID