Parsing string data

Started by Orion, March 19, 2014, 10:59:22 AM

Previous topic - Next topic

Orion

hi guys, i got very simple question about parsing.
I am trying to split the string into two
for example
string = http://www.microsoft.com/cn=computer,ou=contoso,ou=com

i would like to split from /

so string one would be
http://www.microsoft.com
and 2nd cn=computer,ou=contoso,ou=com

I just couldn't figure it out, or may i just need more coffee...

Deana

Here is one way, using an ItemExtract technique.
Code (winbatch) Select

str = 'http://www.microsoft.com/cn=computer,ou=contoso,ou=com'
; First parse off Protocol
protocol = 'http://'
delim = '/'
newstr = StrSub( str, StrLen( protocol )+1, -1 )
; Extract first and second items in a list delimited with '/'
firsthalf = protocol : ItemExtract( 1, newstr, delim )
secondhalf = ItemExtract( 2, newstr, delim )
Pause( firsthalf, secondhalf )
exit
Deana F.
Technical Support
Wilson WindowWare Inc.

Orion