Liberty BASIC Help Online

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$( )
 


Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/