title: Identifying that a property's value is an array
body: <p>I have a JSON file:</p>
  
  <pre class="lang-js prettyprint-override"><code>{  
     "abn":"63119059513",
     "acn":"119059513",
     "business_structure":"Private Company",
     "ngr_number":"1231231",
     "cbh_number":"1231231",
     "main_name":"Brickworks Building Products Pty Ltd",
     "trading_name":"Brickworks",
     "other_trading_names":"Austral Bricks",
     "directors":[  
        {  
           "ID":"12114",
           "ae_forms_filled_in_ID":"22739",
           "name":"John Smith",
           "dob":"1983-10-29",
           "address_line_1":"123 Fake Street",
           "address_line_2":"",
           "address_line_city":"Fakeland",
           "address_line_postcode":"2000",
           "address_line_state":"New South Wales",
           "address_line_country":"Australia",
           "order_extract_id":null,
           "director_found":null,
           "drivers_lic":"",
           "home_mortgage":"",
           "phone":"",
           "mobile":"",
           "director_email":"",
           "director_title":"Mr",
           "director_position":"Director",
           "dir_pdf_url":null
        }
     ],
  
  }
  </code></pre>
  
  <p>I want to determine if the value of any property has a structure of an array. The best I can come up with so far is:</p>
  
  <pre class="lang-cs prettyprint-override"><code>StreamReader streamrr = new StreamReader("C:\\temp\\agfarm_example_udate.json", Encoding.UTF8);
  
  string JSON = streamrr.ReadToEnd();
  
  JObject CWFile = JObject.Parse(JSON);
  foreach (JProperty property in CWFile.Properties())
  {
      // Do something
  
      if (property.Value.ToString().Contains("["))
      {
          // Do something with the array
          JArray items = (JArray)CWFile[property.Name];
  
          foreach (JObject o in items.Children&lt;JObject&gt;())
          {
              foreach (JProperty p in o.Properties())
              {
                 // Do something
              }
          }
      }
  }
  </code></pre>
  
  
  
  <p>To determine whether or not a property value has an array, I used the condition:</p>
  
  <pre><code>if (property.Value.ToString().Contains("["))
  </code></pre>
  
  <p>I'm just wondering if there is a better way of doing this check?</p>