How many occurrences

Given a string and substring, write a method that returns number of occurrences of substring in the string. Assume that both are case-sensitive. You may need to use library function here.
Expected input and output
HowManyOccurrences("do it now", "do") → 1 HowManyOccurrences("empty", "d") → 0
using System;

namespace CSharpExercises.Exercises.Strings
{
    class HowManyOccurrencesTask
    {
        static int HowManyOccurrences(string str, string subStr)
        {
            int found;
            int total = 0;
            for (int i = 0; i < str.Length; i++)
            {
                found = str.IndexOf(subStr, i);

                if (found > -1)
                {
                    total++;
                    i = found;
                }
            }

            return total;
        }

        static void Main(string[] args)
        {
            Console.WriteLine(HowManyOccurrences("He is a good boy, he would never do that!", "he"));           // 1
            Console.WriteLine(HowManyOccurrences("104 593 00-930 720193", "93"));                               // 3
            Console.WriteLine(HowManyOccurrences("xyz", "a"));                                                  // 0
        }
    }
}