Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse string

Status
Not open for further replies.

JonathonC

Technical User
Aug 18, 2001
43
GB
I have the string F,50 and a want to split the string into two, I want to get the part before the comma (F in this case) and the part after it (50 in this case) and then save each of these parts to two separate strings. How would I do this?

Thanks,
Jonathon.
Computer problems? Have you checked the loose nut in front of the keyboard yet?
 
Dim aryStr() As String
aryStr = Split("F,50",",")
if UBound(aryStr) < 1 then Redim Preserve aryStr(1) ' no comma
strF = aryStr(0)
str50 = aryStr(1) Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Thanks John thats exactly what I was looking for.

Jonathon.
Computer problems? Have you checked the loose nut in front of the keyboard yet?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top