Using HtmlAgility Pack I recovered a string from a webpage’s HTML. What’s the best way to parse this data?

[ {"Date":"2015/04/04", "Estimate":"$4.50", "Reported":"3.90"}, {"Date":"2015/03/31", "Estimate":"$4.10", "Reported":"4.20"} ... {"Date":"2015/03/25", "Estimate":"$4.00", "Reported":"4.00"}] 

I created an object with same named properties (Date, Estimate, Reported)

I was thinking of doing it like

string[] dataArray = recoveredString.Split('}'); List<myObject>=new List<myObject>(){new myObject{Date = dataArray.Split(',')[0].Split(':')[1].Replace('\"', ' ').Trim() ....and so on...} 

But it seems like a very long way of doing this.

by pope_says via /r/csharp

Leave a Reply