title: Split a comma-separated Key Value Pair with both quoted
body: <p>I have a string in following format</p>
  
  <pre><code>"Name":"ABC","Address":"Street1,Street2","City":"Pune"
  </code></pre>
  
  <p>I want the output as </p>
  
  <pre><code>Name = ABC
  Address = Street1, Street2
  City = Pune
  </code></pre>
  
  <p>The code I am using is</p>
  
  <pre><code> public string[] GetData(string op)
  {
      MDB result = new MDB();
      var split = op.Split(':');
      string[] keyValue;
      foreach (string s in split)
      {
          keyValue = s.Split(',');
  
          try
          {
              PropertyInfo propertyInfo = result.GetType().GetProperty(keyValue[0]);
  
              if (propertyInfo != null)
              {
                  propertyInfo.SetValue(result, Convert.ChangeType(keyValue[1], propertyInfo.PropertyType), null);
              }
          }
          catch (Exception ex)
          {
  
          }
      }
  }
  </code></pre>
  
  <p>However when I split the text at "," I get following result</p>
  
  <pre><code>Name= ABC
  Address = Street1
  </code></pre>
  
  <p>How can I get Street2 in address?</p>