Search code examples
c#windows-8.net-4.0windows-phone-7.1portable-class-library

How to decode a URL in Portable Class Library (PCL)?


I'm looking for the equivalent of System.Web.HttpUtility.UrlDecode() method in Portable Class Library (PCL) that can target all the supported platforms (.Net 4.0+, WP 7.5+ and Windows 8+)


Solution

  • This will do:

    var urlDecoded = Uri.UnescapeDataString(urlEncoded).Replace('+', ' ');