Decode escaped Url without using HttpUtility.UrlDecode

前端 未结 8 1721
盖世英雄少女心
盖世英雄少女心 2020-12-05 09:52

Is there any function that converts an escaped Url string to its unescaped form? System.Web.HttpUtility.UrlDecode() can do that job but I don\'t want to add a r

8条回答
  •  借酒劲吻你
    2020-12-05 09:58

    EDIT: Use the static method Uri.UnescapeDataString() to decode your URLs:

    Encoded: http%3a%2f%2fwww.google.com%2fsearch%3fhl%3den%26q%3dsomething%20%2323%26btnG%3dGoogle%2bSearch%26aq%3df%26oq%3d

    Decoded: http://www.google.com/search?hl=en&q=something #23&btnG=Google+Search&aq=f&oq=

提交回复
热议问题