Method for string

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?
 
K

khawkins

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top