String Class The System. String class provides rich functionality for manipulating strings. String, you can determine a string's length, search for substrings, change the case of a string, compare two strings, and split strings, among other things. You use the Length property to determine a string's length. You use the IndexOf method to extract the first instance of a substring from a string.
All searches are case sensitive.
IndexOf is overloaded, allowing you to pass it a parameter of type Char, String, or an array of type Char. Dim i As Integer lblOutput. The output generated by this page is shown in Figure 2. IndexOf takes two optional parameters that let you limit the search by specifying the starting and ending position within the string to search. The LastIndexOf method is identical to IndexOf except that it searches for the last instance of a substring.