Looking to find a way, via string match, to find multiple occurrences of the same word using the streamreader class and contains method (or some other approach). Below only returns a match on the first occurrence, however if I'm evaluating a string that has "the" 3 times in the string, how can I capture all 3 of those for a count result?
while ((line = file.ReadLine()) != null)
{
if (line.Contains(text))
{
counter++;
}
}