View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default extracting chars from strings (Visual Basic)

Hi,

MyString = "ABCDEFG"
MyChar = Mid(MyString, 4, 1)
Mike

"Robert Crandal" wrote:

If I have a string variable in Visual Basic, which function do I
use to extract/or read a single character in the string??

For example, given the following string:

myString = "ABCDEFG"

How can I instruct Visual Basic to extract the 4th character from
the string??? (which is letter/char 'D')

(In C++, this is equivalent to myString[4])

Thank you!



.