-
Man.. am I ever asking annoying questions ;)
What is the method of getting at the 1st element in a string? Kinda figured out that str(0) won't quite do the job for me. And don't have my reference book handy.:( Anyone mind giving me the quick n dirty chunk of code I need to do this, thanks ;)
If you are wondering, I am firing in a huge chunk of data in my serial port, which I have a header byte telling the app whats in the rest of the chunk is. Do particular cases send appropriate stuff to turn devices on and off, and so forth.
Just need to know how I get at that first subscript ;)
-
Hi,
I guess left(myString,1) won't do the trick... or? Otherwise try to spilt the string!
Code:
theString = "Try to split"
myString = Split(theString, " ")
result = myString(0)
The result-variable will now hold "Try".
-
Or use InStr.
Code:
TheString = "Try to split"
MsgBox Left(TheString, InStr(1, TheString, " ") - 1)