Mid function
Returns a specified number of characters from a string.
Mid(string, start[, length])
Parameters
String
A string expression from which to return a character. If string contains null, nullis returned.
Start
The start position of the extracted character part in string . If start exceeds the number of characters in string ,Mid returns a 0 length string ("").
Length
The number of characters to return. If omitted or length exceeds the number of characters in the text, including the character at start , all characters in the string ending from start to String are returned.
Description
To determine the number of characters in a string , you can use the Len function.
The following example uses the Mid function to return six characters starting from the fourth character in a string:
Mid("VBScript is fun!", 4, 6) 'MyVar contains "Script" .
Attention The MidB function is used in conjunction with the byte data contained in the string. The parameter is not the specified number of characters, but the number of bytes.