MID$( )

MID$(string, index, [number])

Description:

This function permits the extraction of a sequence of characters from the string, string variable, or string expression string starting at index. [number] is optional. If number is not specified, then all the characters from index to the end of the string are returned. If number is specified, then only as many characters as number specifies will be returned, starting from index.

Usage:

  print mid$("greeting Earth creature", 10, 5)

Produces:

  Earth

And:

  string$ = "The quick brown fox jumped over the lazy dog"
  for i = 1 to len(string$) step 5
    print mid$(string$, i, 5)
  next i

Produces:

The q
uick
brown
 fox
jumpe
d ove
r the
 lazy
 dog

Note:

See also LEFT$( ) and RIGHT$( ) and REPLSTR$( )