The
mid$
statement replaces the characters in StrVar, beginning
at position NumExpr1, with characters in StrExpr.
StrVar must be a string variable or array element.
StrExpr may be any string expression.
NumExpr1 may be any numeric expression with a positive value.
NumExpr2 is optional.
If present, it must be a numeric expression with a non-negative value.
NumExpr2 refers to the number of characters from StrExpr that will be
used in the replacement.
If NumExpr2 is omitted, all of StrExpr is used.
The length of StrVar does not change, regardless of whether NumExpr2 is
omitted or included, or whether StrExpr is either greater or less than
StrVar in length.
EXAMPLE
This example uses the
mid$
statement to replace characters in a string.