Top | Up (String) | < Previous (PAGE NAME) | Next (PAGE NAME) >
Extract characters from the right side of a string.
RIGHT$ string$, length% OUT substring$
Parameter | Description |
---|---|
string$ | A string |
length% | The number of characters to extract. Can’t be less than 0. If greater than the length of string$ , the entire string is returned. |
Output | Description |
---|---|
substring$ | The rightmost length% characters of string$ |
RIGHT$
always returns a new string, even if length%
is greater than or equal to the length of string$
.
PRINT RIGHT$("TEST",2) ' ST
PRINT RIGHT$("AAAAA",200) ' AAAAA
Error | Cause |
---|---|
Out of range | length% is less than 0 |
Top | Up (String) | < Previous (PAGE NAME) | Next (PAGE NAME) >