RIGHT$
A string function which returns the right ‘num’ characters of the string. If there are insufficient characters in the string then all are returned.
There must not be any spaces between the RIGHT$ and the opening bracket.
A$=RIGHT$(A$,num)
A$=RIGHT$(A$,2)
A$=RIGHT$(LEFT$(A$,3),2)For example,
10 name$="BBC BASIC(Z80)"
20 FOR i=3 TO LEN(name$)
30 PRINT RIGHT$(name$,i)
40 NEXTwould print
80)
Z80)
(Z80)
C(Z80)
IC(Z80)
SIC(Z80)
ASIC(Z80)
BASIC(Z80)
BASIC(Z80)
C BASIC(Z80)
BC BASIC(Z80)
BBC BASIC(Z80)Syntax
<s-var>=RIGHT$(<str>,<numeric>)Associated Keywords
LEFT$, MID$
Last updated on