Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>mid$ substring in middle</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MID$                     Substring in Middle

 s$ = MID$(stringexpr, position [,length])             ' Function
 MID$(stringvar, position [,length]) = stringexpr      ' Statement

    Returns a specified number of characters from a string, beginning at a
    specified character position (function format). Also can assign all or
    some of a string expression to a string variable, beginning at a
    specified character position within the string variable (statement
    format).

  stringexpr    A string expression.

   stringvar    The string variable whose characters will be replaced.

    position    A numeric expression in the range 1 to 32767;, specifies
                the character position from which the substring is to be
                extracted.

      length    A numeric expression in the range 0 to 32767; specifies
                the number of characters to return.

   -------------------------------------------------------------------------

      Notes:    In the function format, if length is omitted, MID$ returns
                all the characters in the string beginning at character
                position. If position is greater than the length of
                stringexpr, a null string is returned.

                In the Statement format, the characters in stringexpr
                replace length characters in stringvar, beginning at
                character n.

                In the statement format, the length of stringvar will
                never increase as a result of a MID$ statement. For
                example, if stringvar is seven characters long, and n is 3
                and length is 6, only the first five characters of
                stringexpr will be assigned to stringvar.

See Also: LEFT$ RIGHT$

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson