Number of words

Given a string, write a method that counts its number of words. Assume there are no leading and trailing whitespaces and there is only single whitespace between two consecutive words.
Expected input and output
NumberOfWords("This is sample sentence") → 4 NumberOfWords("OK") → 1
using System;

namespace CSharpExercises.Strings
{
    class NumberOfWordsTask
    {
        static int NumberOfWords(string str)
        {
            int numberOfWords = 0;
            for (int i = 1; i < str.Length; i++)
            {
                numberOfWords = (char.IsWhiteSpace(str[i]) ? numberOfWords + 1 : numberOfWords);
            }

            return numberOfWords + 1;
        }

        static void Main(string[] args)
        {
            Console.WriteLine(NumberOfWords("Mauris consectetur urna sit amet risus ultricies rutrum.")); // 8
            Console.WriteLine(NumberOfWords("Quisque M"));                                                // 2
            Console.WriteLine(NumberOfWords("Xor"));                                                      // 1
        }
    }
}