string to JsonObject in C#
What is the best way to convert a (properly Json-formatted) String
object into a System.Json.JsonObject
? Right now I create a StringReader
and use System.Json.JsonObject.Load
.
(This is really kind of academic, since I think I'll alw开发者_如何学编程ays be dealing with the raw Json in System.IO.Stream
form.)
You could simply use the System.Json.JsonValue.Parse
static method to parse a string directly rather than use a StringReader
.
精彩评论