Sharp MZ-700 Series Owner's Manual page 79

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

2.5.2 LEFT$, MID$, and RIGHT$
The LEFTS, MID$, and RIGHTS functions are used to extract character strings from the left end, right
end, or middle of a character expression.
Format
X$: String expression
m and n: Numeric expressions
Function
Example
(when AS = "ABCDEFG")
Remarks
LEFTS (XS,
n)
Returns the character
string consisting of the n
characters making up the
left of string expression
x s .
B$= LEFTS (AS, 2)
B $ "
A B
C D E F G
Substitutes 2 characters from
the left end of string variable
AS into string varible BS.
Thus, BS = AB
1
.
0 < n ^ 255
MIDS (XS, m, n)
Returns the character
string consisting of the n
characters making up the
n characters starting with
the mth character in string
expression X$.
B$=MID$ (AS, 3, 3)
1 < m ^ 255
0 < n < 255
MIDS (XS, m, n)
Returns the character
string consisting of the n
characters making up the
n characters starting with
the mth character in string
expression X$.
B $ « - I
A B
C D E F G
1 < m ^ 255
0 < n < 255
MIDS (XS, m, n)
Returns the character
string consisting of the n
characters making up the
n characters starting with
the mth character in string
expression X$.
Substitutes the 3 characters
starting at the 3rd character
in string variable AS into
string variable B$.
1 < m ^ 255
0 < n < 255
Returns the character
string consisting of the n
characters making up the
n characters starting with
the mth character in string
expression X$.
Substitutes the 3 characters
starting at the 3rd character
in string variable AS into
string variable B$.
RIGHTS (XS, n)
Returns the character
string consisting of the n
characters making up the
right end of string ex-
pression X$.
BS = RIGHTS (AS, 2
B S — |
A B O D E
)
F G
n ^ 255
RIGHTS (XS, n)
Returns the character
string consisting of the n
characters making up the
right end of string ex-
pression X$.
Substitutes 2 characters
from the right end of string
variable AS into string
varible BS.
Thus, BS = "FG".
n ^ 255

Advertisement

Table of Contents
loading

Table of Contents