split a 1 string into 2 strings

I have a string that looks like:

String1= Userid=123 password=1234 CICSID=123 CICSPassword=1234

I would like to create 2 stings that looks like:

String2=  Userid=123 password=1234
String3=  CICSID=123 CICSPassword=1234

I am just not sure how to split this at CICSID-123

Thanks, Chad
chadmanvbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ashish PatelCommented:
Very easiest method of doing is below, if your string is going to be in same format.

String1= "Userid=123 password=1234 CICSID=123 CICSPassword=1234"

String2= Split(String1, " ")(0) & " "  & Split(String1, " ")(1)
String3= Split(String1, " ")(2) & " "  & Split(String1, " ")(3)
0
chadmanvbAuthor Commented:
Well string1 will change a lot, but one thing that will always be consistant will be "CICSID=".  That is also where I need to split it.  Chad
0
Ashish PatelCommented:
Now try this, as this will always split at CICSID.


String1= "Userid=123 password=1234 CICSID=123 CICSPassword=1234"

String2 = Mid(String1, 1, Instr(1, String1, "CICSID=")-1)
String3 = Mid(String1, Instr(1, String1, "CICSID="))
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chadmanvbAuthor Commented:
Thanks, that did it.  Chad
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.