There is an XML string that contains something like the following: <age>8+</age>
As you probably guessed, the "+" is the problem :)
I want to get that XML string from QueryString, however, the "+" appears as a " " (space), not a "+".
I have tried the following:
Expand|Select|Wrap|Line Numbers
- NameValueCollection coll = Request.QueryString;
- XMLstring = coll.Get("XMLstr"); // result: XMLstring = "<age>8 </age>"
Expand|Select|Wrap|Line Numbers
- XMLstring = Request.QueryString["XMLstr"]; // result: XMLstring = "<age>8 </age>"
Expand|Select|Wrap|Line Numbers
- XMLstring = Request.QueryString.Get("XMLstr"); // result: XMLstring = "<age>8 </age>"
Expand|Select|Wrap|Line Numbers
- XMLstring = HttpUtility.HtmlDecode(Request.QueryString["XMLstr"]); // result: XMLstring = "<age>8 </age>"
Expand|Select|Wrap|Line Numbers
- XMLstring = HttpUtility.HtmlDecode(Request.QueryString.Get("XMLstr")); // result: XMLstring = "<age>8 </age>"
I realise I can just search XMLstring and replace the space with the plus sign. I don't want to do that :)
Also, this isn't my code, and I have no idea why XML is in QueryString nor if it should be there, but it
has to stay like this for the moment, and I have to somehow extract that + sign.
Any help/advice is appreciated.
Thank you.