I am trying to find a path of a JSON value. Consider the following JSON:
{ \"car\": { \"type\": [{ \"sedan\": { \"mak
You could also try the SelectToken method like this:
SelectToken
var j = JObject.Parse(json); var token = j.SelectToken("car.type[0].sedan.make"); Console.WriteLine(token.Path + " -> " + token.ToString());
Outputs:
car.type[0].sedan.make -> honda