MID$

This command will extract a character from the string provided.

  Syntax
Return String=MID$(String,Value)
  Parameters
String
String
The string that will be use
Value
Integer
The specified position within the string to get character from

  Returns

The value returned is the character found at the specified position within the string

  Description

The return string will contain a single character extracted from the string specified. If the value is greater than the number of characters in the string then an empty string is return. If the value is negative or zero then an empty string is returned. The value provided should ideally be a positive integer value.

  Example Code
PRINT "hello world  left:";LEFT$("hello world",5);"  mid:";MID$("hello world",5);"  right:";RIGHT$("hello world",5)
WAIT KEY
  See also

TEXT Commands Menu
Index