Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
MID$ Function, MID$ Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
MID$(stringexpression$, start% [,length%])
MID$(stringvariable$, start% [,length%]) = stringexpression$
Usage Notes
■ The arguments start% and length% must be numeric expressions between
1 and 32,767, inclusive.
■ If length% is omitted from the MID$ function or if there are fewer than
length% characters in the string (including the start character), the
MID$ function returns all characters from the position start% to the end
of the string.
■ The optional length% refers to the number of characters from the
argument stringexpression$ that are used in the replacement. If length%
is omitted from the MID$ statement, all of stringexpression$ is used.
However, regardless of whether length% is omitted or included, the
replacement of characters never goes beyond the original length of
stringvariable$.
■ If start% is greater than the number of characters in stringexpression$,
MID$ returns a null string.
■ Use the LEN function to find the number of characters in
stringexpression$. See: ◄LEN Function►