Returns the lChars characters of the string sStr, starting from the lStart character.
[ s = ] Mid ( sStr, lStart [, lChars ] )
The Mid procedure syntax has the following parts:
Name |
Type |
Description |
s |
BString |
Result string |
sStr |
Val BString |
Input string |
lStart |
Val Long |
Start position (0 is the first position) |
lChars |
Val Long |
Number of characters to return (default is -1) |
If lChars is not supplied, then the remainder of the string is returned.
If lStart plus lChars is greater then the length of sStr, the returned string is truncated to the length of sStr. If lStart is greater than or equal to the length of sStr, then s is returned as an empty string.
Print Mid("ATEasy", 2) ! This will print "Easy"
Print Mid("ATEasy", 0, 3) ! This will print "ATE"