Overload:Newtonsoft.Json.Linq.JToken.SelectToken provides a method to query LINQ to JSON using a single string path to a desired T:Newtonsoft.Json.Linq.JToken. SelectToken makes dynamic queries easy because the entire query is defined in a string.

# SelectToken

SelectToken is a method on JToken and takes a string path to a child token. SelectToken returns the child token or a null reference if a token couldn't be found at the path's location.

The path is made up of property names and array indexes separated by periods. Array indexes can use either square or round brackets. Both of the following are valid paths and are equivalent to each other: Manufacturers[0].Name and Manufacturers(0).Name.

SelectToken Example

# SelectToken with LINQ

SelectToken can be used in combination with standard LINQ methods.

SelectToken With LINQ Example

LINQ to JSON
LINQtoJSON.htm
_self
Overload:Newtonsoft.Json.Linq.JToken.SelectToken