Given the following example "strings":
- somePage.aspx?id=20&name=brian&token=1234
- somePage.aspx?id=20&token=1234&name=brian
- somePage.aspx?token=1234&id=20&name=brian
I want to remove the name/value pair for token in all cases, so I am left with:
- somePage.aspx?id=20&name=brian
- somePage.aspx?id=20&name=brian
- somePage.aspx?id=20&name=brian
Note: I cannot use the Uri class for various reason.
Is there a single regex or string function that can do this?
I cannot use the Uri class for various reasonfor example?System.Webreference is just too much bloat? I've come across that.System.Webwould cause his application to break for anyone who only has .Net 4.0 Client Profile installed (which is the default installation of .Net on many W7 machines), so it makes sense to avoidSystem.Webto reduce deployment problems.