A simple JSON library for C#.
A minimalist JSON library designed to easily encode and decode JSON messages.
var json = new JsonObject
{
["menu"] = new JsonArray
{
"home",
"projects",
"about",
}
}.ToString(pretty: true);
JSON output:
{
"menu": [
"home",
"projects",
"about"
]
}
In this example, the variable json
contains the string generated in the previous example.
var menu = JsonValue.Parse(json)["menu"].AsJsonArray;
foreach (var item in menu)
{
Console.WriteLine(item);
}
Console output:
home
projects
about
MIT License (Read License).