The position within target at which the replacement begins
length(optional; Long)
The number of characters in target to replace
expression(required; String)
The string used to replace characters within target
Description
The Mid statement replaces a section of a string with characters from another string.
Usage at a Glance
If you omit length, as many characters of string as can fit into target are used.
If start + length is greater then the portion of target to be replaced, string is truncated to fit in the same space as that portion of target. The length of target is not altered by the Mid statement.
If start is less than zero, an error occurs.
If string is Nothing, a runtime error occurs.
VB includes the Replace function, which enhances the functionality of the Mid statement by allowing you to specify the number of times a replacement is carried out in the same string.
Because it is a statement, this version of Mid does not accept named arguments. Mid is implemented by the compiler rather than by the String data type.