Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 684 Bytes

ParseJsonAny.md

File metadata and controls

29 lines (20 loc) · 684 Bytes

Parse JSON using JToken.Parse

This sample parses JSON using Argon.JToken.Parse(System.String).

var t1 = JToken.Parse("{}");

Console.WriteLine(t1.Type);
// Object

var t2 = JToken.Parse("[]");

Console.WriteLine(t2.Type);
// Array

var t3 = JToken.Parse("null");

Console.WriteLine(t3.Type);
// Null

var t4 = JToken.Parse("'A string!'");

Console.WriteLine(t4.Type);
// String

snippet source | anchor