title: C# Json.NET convert string to JSON key
body: <p>My app is accepting user input as json key, how can I convert string <code>a[0].b</code> to json key?</p>
  
  <pre><code>using Newtonsoft.Json.Linq;
  
  string keys = "a[0].b";
  dynamic js = dynamic js = JObject.Parse("{'a': [{'b' : 'hello'}, {'b': 'world'}]}");
  
  //Console.WriteLine(js.a[0].b); // world
  
  Console.WriteLine(js["a[0].b"]); // error
  Console.WriteLine(js[keys]); // error
  </code></pre>