C#中的任何函数处理如JavaScript的转义/取消
我有一个这样的JSON字符串:
{"Feeds":[{"Url":"www.test.com","FeedType":"Twitter"},{"Url":"www.test2.com","FeedType":"Youtube"}]}
在escape()后看起来像这样escape()
%7B%22Feeds%22%3A%5B%7B%22Url%22%3A%22www.test.com%22%2C%22FeedType%22%3A%22Twitter%22%7D%2C%7B%22Url%22%3A%22www.test2.com%22%2C%22FeedType%22%3A%22Youtube%22%7D%5D%7D
在我的C#代码中,我想取消对这个字符串的描述,以便它看起来和escape()之前完全一样,
这可能吗?
Are the any functions in C# that handle escape/unescape like JavaScript?
I have a JSON string like this:
{"Feeds":[{"Url":"www.test.com","FeedType":"Twitter"},{"Url":"www.test2.com","FeedType":"Youtube"}]}
Which looks like this after escape()
%7B%22Feeds%22%3A%5B%7B%22Url%22%3A%22www.test.com%22%2C%22FeedType%22%3A%22Twitter%22%7D%2C%7B%22Url%22%3A%22www.test2.com%22%2C%22FeedType%22%3A%22Youtube%22%7D%5D%7D
In my C# code I would like to unescape this string so that it looks exactly the same as it did before the escape()
Is this possible?
最满意答案
HttpUtility.UrlDecode应该做的伎俩。
HttpUtility.UrlDecode should do the trick.
更多推荐
发布评论