How to Split and strip X string values into separate variables?
X has string value of
itemA=myvalue&itemB=anothervalue&itemC=andanother
I have 3 strings (var1,var2,var3) to hold the values of the stripped values.
Find in string X “itemA=” copy everything after “=” character until “&” character OR if no “&” character is found copy until end of string (store this value into var1)
Find in string X “itemB=” copy everything after “=” character until “&” character OR if no “&” character is found copy until end of string (store this value into var2)
Find in string X “itemB=” copy everything after “=” character until “&” character OR if no “&” character is found copy until end of string (store this value into var3)
Using System.Web.HttpUtility. You can use this even in a non Web application, if a reference to
System.Webis not a problem.You can list all the keys: