3

I've got a raw text string in the form:

http://www.site.com/abc/%3FSubscriptionId%3DAKIAI5N2ARPTHQHTRGMA%26creative%3D165953%26creative%3DB0058RECN6

Are there any built in utilities to unescape those characters?

I'm using ASP.NET MVC 3

Fixer
  • 5,985
  • 8
  • 40
  • 58
  • You may want to look at this post on the different methods... http://stackoverflow.com/questions/602642/server-urlencode-vs-httputility-urlencode – EBarr Jan 30 '12 at 18:08

2 Answers2

5

Try this below

var  decodedString = System.Web.HttpUtility.UrlDecode("http://www.site.com/abc/%3FSubscriptionId%3DAKIAI5N2ARPTHQHTRGMA%26creative%3D165953%26creative%3DB0058RECN6");
scartag
  • 17,548
  • 3
  • 48
  • 52
3

The HttpUtility.UrlDecode method should do it for you.

D'Arcy Rittich
  • 167,292
  • 40
  • 290
  • 283
  • Not sure how to use this as it's not a static method and you cannot instantiate the class since it has no public ctor's? – Fixer Jan 30 '12 at 18:09