Mid Function in VB.NET
What is Mid() function in VB.NET?
in Visual Basic.net is a string function that is used to extract a copy of a character or set of characters from a string.
Function Mid( ByVal Str As String, ByVal Start As Integer,
Optional ByVal Length As Integer) As String
In the above syntax Str
specifies the string from which the characters to be extracted
from the starting position specified using Start
, until the specifed Length
Dim Str As String = "Seven Wonders of the World"
Console.WriteLine("It is a beautiful" & Mid(Str, 21, 6))
It is a beautiful World
In the above example, the word 'world' is extracted from the string to write another string.