Instr parsing of a variable

I have a variable called: ResultA, it 30 chars long.

How would I get the first 10 chars off ResultA and set that as its own variable ResultB.
Then grab the char 12 thru 17 and set that as another variable ResultC

I am new to VB / VBS, and have not used Instr much and am looking for some help.
Please advise and thanks.
RWayneHAsked:
Who is Participating?
 
Michael FowlerSolutions ConsultantCommented:
The methods Left and Mid are what you need
http://www.w3schools.com/vbscript/func_left.asp
http://www.w3schools.com/vbscript/func_mid.asp

So

ResultB = Left(ResultA, 10)
ResultC = Mid(ResultA, 12, 5)

Open in new window

0
 
Wayne Taylor (webtubbs)Commented:
Dim ResultA, ResultB
ResultA = "abcdefghijklmnopqrstuvwxyz"
ResultB = Left(ResultA, 10)

Open in new window

0
 
Michael FowlerSolutions ConsultantCommented:
Note: the W3Schools VB Script tutorial is very good
http://www.w3schools.com/vbscript/default.asp
0
 
RWayneHAuthor Commented:
Worked great. thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.