string json = \"{\\\"People\\\":[{\\\"FirstName\\\":\\\"Hans\\\",\\\"LastName\\\":\\\"Olo\\\"}
{\\\"FirstName\\\":\\\"Jimmy\\\",\\\"LastName\
Since you are using JSON.NET, personally I would go with serialization so that you can have Intellisense support for your object. You'll need a class that represents your JSON structure. You can build this by hand, or you can use something like json2csharp to generate it for you:
e.g.
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class RootObject
{
public List People { get; set; }
}
Then, you can simply call JsonConvert
's methods to deserialize the JSON into an object:
RootObject instance = JsonConvert.Deserialize(json);
Then you have Intellisense:
var firstName = instance.People[0].FirstName;
var lastName = instance.People[0].LastName;