Method for string

  • Thread starter Thread starter nexus
  • Start date Start date
N

nexus

It is possible to retrieve a particular character by
referencing the index of that character through the Chars
property. For example:

Dim myString As String = "ABCDE"
Dim myChar As Char
myChar = myString.Chars(3) ' myChar = "D"

but what if i want to retrieve both letter in the 2nd and
3rd position from the character? Is it possible?
 
You can also us in combination with the left, right, and mid string function the instr() function. The you can put your search string in a variable, then with the instr() you can get the location of the string you are looking for and then using the left, right, or mid string functions pull it out if needed.
 
Back
Top