假设我有这些 JSON 字符串:
string s1 = "{\"foo\":\"wh\"o\"a\"}";
string s2 = "{\"foo\":{\"bar\":123}}";
我想以字符串格式获取 foo 的值,所以我想从 s1 中获取"wh\"o\"a"
并从 s2中获取"{\"bar\":123}"
。但是,如果我这样做
JsonObject j = JsonObject.Parse(s1);
string foo = j.Get("foo");
foo 包含"wh"
来自 s1 和"{"
来自 s2。如何使用 JsonObject 获取 JSON 字段的原始字符串值?