[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

split a 1 string into 2 strings

Posted on 2008-01-24
4
Medium Priority
?
440 Views
Last Modified: 2013-11-26
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
0
Comment
Question by:chadmanvb
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20737381
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
 

Author Comment

by:chadmanvb
ID: 20737494
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
 
LVL 23

Accepted Solution

by:
Ashish Patel earned 2000 total points
ID: 20737556
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
 

Author Closing Comment

by:chadmanvb
ID: 31424758
Thanks, that did it.  Chad
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question