Click here to Skip to main content
16,017,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All I trying to parse out a url that is being returned from a web service and I want to parse the parameter values returned this is what the url looks like when it is returned from the web service

href="http://emhaallrca/HMALED_EMH/edchartlink.aspx?token=wpLJXBWvloRJFKWY7UhAWSAJT4fHOW4dzLniQSkYRuTtvrq7rbugLvc%2f8FI%3d&chart=dLmvQiUSZQwaFHcfu1seUlOjAoKNfqEJyTF%2bRvkgv3mpHJynG3P5S1VjjTpPwMSJPLfDNTLbE0i8vdDU

Im interested in getting the values of token and chart.

I thought of using split() and load things in an array but it would be two different values to look for not easy.

Does anybody have any suggestion or can point me to an article I can read. Google hasn't been much help.

Thanks
Posted

You are in the right direction. You would need to do split() few times. First with "?" this will device the url from the querystring. Then on the querystring you will do another split() with "&" which will give you

token=wpLJXBWvloRJFKWY7UhAWSAJT4fHOW4dzLniQSkYRuTtvrq7rbugLvc%2f8FI%3d
chart=dLmvQiUSZQwaFHcfu1seUlOjAoKNfqEJyTF%2bRvkgv3mpHJynG3P5S1VjjTpPwMSJPLfDNTLbE0i8vdDU

now either you can processed with another split or since your know your syntex you can use string manipulations.
 
Share this answer
 
Dim WordArray,WordArray1

WordArray=Split(TheUrl,"?")
WordArray=Split(WordArray(1),"&")  'Get two parameter expression

WordArray1 = Split(WordArray(0),"=")
token = WordArray1(1)

WordArray1 = Split(WordArray(1),"=")
chart = WordArray1(1)
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900