1

大家好,我收到来自服务器的 json 响应,其中包含以下文本:

<div class=\"profile-info\">\u0413\u043e\u0440\u043e\u0434: \u041a\u043e\u0432\u0440\u043e\u0432<\/div>

如何解码\u0413\u043e\u0440\u043e\u0434: \u041a\u043e\u0432\u0440\u043e\u0432

4

1 回答 1

1
Regex regex = new Regex(@"\\u([a-f0-9]{4})", RegexOptions.IgnoreCase);
String result = regex.Replace(result, match => ((Char)Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString());
于 2013-01-21T20:03:22.770 回答