title: Extracting a value from Json object in C#
body: <p>I have a Json document and I am trying to get the value for AnalogInput for each channel from 1 to 4. 
  I have tried this code:</p>
  
  <pre><code> JObject originalObject = JObject.Parse(testJsonObject);
   var analogInputTrueValues = originalObject.Descendants().OfType&lt;JProperty&gt;().Where(p =&gt; p.Name == "DigitalInput").Select(x =&gt; x.Value).ToArray();
  </code></pre>
  
  <p>where testJsonObject is the Json file that gets loaded by another method. </p>
  
  <p>Debugging the code, the value for analogInputTrueValues is:</p>
  
  <pre><code>{Newtonsoft.Json.Linq.JToken[4]}
      [0]: {13}
      [1]: {13}
      [2]: {14}
      [3]: {14}
  </code></pre>
  
  <p>,which is correct. but I am interested to have an array or a list like {"13","13","14","14"}. This is where I can not move forward since I can not extract those exact values and have them in a list or an array. 
  Even when I do:</p>
  
  <pre><code>digitalInputTrueValues.GetValue(0)
  {13}
      base: {13}
      HasValues: false
      Type: String
      Value: "13"
  </code></pre>
  
  <p>I can't extract the Value, which is what I am interested in. 
  How can I get around this kind of problem and extract my desired values? 
  The object that I am working with is as follows:</p>
  
  <pre><code>{
          "module": {
              "serial": "3",
              "label": "A",
              "lat": "B",
              "long": "C",
              "channels": [
  {"channel": "1", "label": "Channel 1", "AnalogInput": "13", "AnalogInputRaw": "13", "AnalogInputScale": "Raw", "DigitalInput": "Off"},
  {"channel": "2", "label": "Channel 2", "AnalogInput": "13", "AnalogInputRaw": "13", "AnalogInputScale": "Raw", "DigitalInput": "On"},
  {"channel": "3", "label": "Channel 3", "AnalogInput": "14", "AnalogInputRaw": "14", "AnalogInputScale": "Raw", "DigitalInput": "On"},
  {"channel": "4", "label": "Channel 4", "AnalogInput": "14", "AnalogInputRaw": "14", "AnalogInputScale": "Raw", "DigitalInput": "On"}
              ],
              "variables": [
               {"1": "0"},
               {"2": "0"},
               {"3": "1"},
               {"4": "0"}
              ]
          }
  }
  </code></pre>