To determine the number of characters in string, use the Len function.
The following example uses the Mid function to return six characters, beginning with the third character, in a string:
Dim MyVar
MyVar = Mid("VBScript is fun!", 3, 6) ' MyVar contains "Script".
Note: |
|---|
The
MidB function is used with byte data contained in a string. Instead of specifying the number of characters, the arguments specify numbers of bytes.
|