如何在C#中将以下字符串解析为json对象:
string unescapedstring = " {"SettingName":"name","SettingValue":"\\log1\\log2\\","Description":"description"}"
得到:
{
"SettingName": "name",
"SettingValue": "\\log1\\log2\\",
"Description": "description"
}
感谢。
答案 0 :(得分:0)
您可以使用JObject
类及其接受字符串作为参数的方法.parse
:
JObject jo = JObject.Parse(unescapedstring);
<强> Newtonsoft_Json Library 强>