VB6Parse / Library / String Manipulation / mid

VB6 Library Reference

Mid Statement

Replaces a specified number of characters in a Variant (String) variable with characters from another string.

Syntax

Mid(stringvar, start[, length]) = string

Remarks

Examples

Dim s As String
s = "Hello World"
Mid(s, 7, 5) = "VB6!!"     ' s becomes "Hello VB6!!"

s = "ABCDEFGH"
Mid(s, 3) = "123"          ' s becomes "AB123FGH"

s = "Test"
Mid(s, 2, 2) = "XX"        ' s becomes "TXXt"

Reference

Mid Statement - Microsoft Docs

← Back to String Manipulation | View all statements