Download Print this page

VTech PreComputer 2000 Manual page 40

Advertisement

SUBSTRINGS
It is also possible to get substrings of
strings.
A sub$tring is, as you might guess
a part of a string
.
For example: "ABC" is a substring of "ABCDE". The following
three functions operate on substrings.
LEFT$ (A$,N)
This will return the substring from the leftmost of string A$, the first character to
the Nth
character.
Example:
10 A$="ABCDE"
20 B$=LEFT$ (A$+"FGH" ,6)
30 PRINT 8$
RUN
ABCDEF
RIGHT$ (A$,N)
This will return a substring but starting from the Nth character from the end and
running to the last one - the right most character in the string A$.
Example:
10 A$="WHY"
20 B$=RIGHT$(A$+"ME",4)
30 PRINT 8$
RUN
HYME
39

Advertisement

loading
Need help?

Need help?

Do you have a question about the PreComputer 2000 and is the answer not in the manual?