The Mid$ function extracts a substring from the specified string, starting at any position.
Used to extract a part of a string.
var$=Mid$(<source_string>, <start_position>, <length>)
<source_string>, string to extract from.
<start_position>, integer, position in the string to begin extracting from. The first position in the string is 1. If <start_position> is negative, the extraction starts at position 1.
<length>, integer, number of characters to extract.
var$, string, result of the extraction. If <length> is negative or 0, the function returns an empty string (an empty string is ""). If the length of <source_string> (including the character starting at <start_position>) is less than <length>, all the characters from <start_position> to the end of <source_string> are returned in var$.
a$ = Mid$("bcdefg",2,2) ' Returns "cd" in a$
a$ = Mid$("bcdefg",2,0) ' Returns "" in a$
a$ = Mid$("bcdefg",0,2) ' Returns "bc" in a$