In VB.Net, Substring is a method of the String class that is used to extract a substring from a given string. It has two overloads:
Substring(startIndex As Integer) As String: This overload returns the substring that starts at the specifiedstartIndexand continues to the end of the string.
Example usage:
Dim str As String = "Hello, world!" Dim subStr As String = str.Substring(7) 'subStr is "world!"
Substring(startIndex As Integer, length As Integer) As String: This overload returns the substring that starts at the specifiedstartIndexand has a length oflength.
Example usage:
Dim str As String = "Hello, world!" Dim subStr As String = str.Substring(7, 5) 'subStr is "world"
Note that startIndex is 0-based, which means that the first character in the string has an index of 0. Also, if startIndex or length is out of range, an exception will be thrown.