Files
Newtonsoft.Json/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonAny.cs
T
James Newton-King 68eacc480b -JSON Schema fixes
-Fixed static values being included with fields serialization
-Examples! (work in progress)
2013-01-23 21:39:54 +13:00

35 lines
626 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class ParseJsonAny
{
public void Example()
{
JToken t1 = JToken.Parse("{}");
Console.WriteLine(t1.Type);
// Object
JToken t2 = JToken.Parse("[]");
Console.WriteLine(t2.Type);
// Array
JToken t3 = JToken.Parse("null");
Console.WriteLine(t3.Type);
// Null
JToken t4 = JToken.Parse(@"""A string!""");
Console.WriteLine(t4.Type);
// String
}
}
}