I have a JObject
(I'm using Json.Net) that I constructed with LINQ to JSON (also provided by the same library). When I call the ToString()
method on the JObject
, it outputs the results as formatted JSON.
如何将此项的格式设置为"无"?
I have a JObject
(I'm using Json.Net) that I constructed with LINQ to JSON (also provided by the same library). When I call the ToString()
method on the JObject
, it outputs the results as formatted JSON.
如何将此项的格式设置为"无"?
调用JObject的ToString(Formatting.None)
方法.
或者,如果将对象传递给JsonConvert.SerializeObject方法它将返回不带格式的JSON.