I want to count the number of rows in html string returned from API. Any idea to get the rows count without using html agility pack ?
following code will connect to API and return html string for apiContent.
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var response = client.GetAsync(apiURL).Result;
using (HttpContent content = response.Content)
{
Task<string> result = content.ReadAsStringAsync();
apiContent = result.Result;
}
}
now i need to count the numbers of row (tr) from html string in variable "apiContent" but without using html agility pack.