I got a problem that are like this:
{
"animal_zone":[
{
"id":0001
},
{
"id":0002
}
]
}
That is an API that I get from a website (sorry I can't tell the link), what I want from that chunk of text is to just get the category and the id string, is it possible to do so without doing regex? (I'm really bad at it)
Output example that I need (inside an array of string[]):
animal_zone
0001
0002
What I have tried:
private void MClient_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e){
string webResult = Encoding.UTF8.GetString(e.Result);
int goFrom = webResult.IndexOf("\"animal_zone\": [") + "\"animal_zone\": [".Length;
int goTo = webResult.IndexOf("]");
string pveResult = webResult.Substring(goFrom, goTo - goFrom);
}
That code get me the text between " "animal_zone": " and " ] ":
{
"id":0001
},
{
"id":0002
}
But I still don't know how to get the 0001 and 0002 together inside an array of string[]
Or is there better way to get an information from the API website instead of doing it by getting all of the text and substring/split it one by one?
Please help me. Thank you