gistlib
You can access the field property inside the first object in using the following code:
field
in
main.csusing System; using Newtonsoft.Json.Linq; class Program { static void Main(string[] args) { string json = @"{""in"":[{""field"":[""resourcefield""]},23]}"; JObject jObject = JObject.Parse(json); var field = (string)jObject["in"][0]["field"][0]; Console.WriteLine(field); } } 321 chars14 lines
using System; using Newtonsoft.Json.Linq; class Program { static void Main(string[] args) { string json = @"{""in"":[{""field"":[""resourcefield""]},23]}"; JObject jObject = JObject.Parse(json); var field = (string)jObject["in"][0]["field"][0]; Console.WriteLine(field); } }
This will output "resourcefield". Just replace the json variable with the JSON string you want to parse.
json
gistlibby LogSnag