title: Count how many words in each sentence
body: <p>I'm stuck on how to count how many words are in each sentence, an example of this is: <code>string sentence = "hello how are you. I am good. that's good."</code> 
  and have it come out like:</p>
  
  <pre><code>//sentence1: 4 words
  //sentence2: 3 words
  //sentence3: 2 words
  </code></pre>
  
  <p>I can get the number of sentences</p>
  
  <pre><code>    public int GetNoOfWords(string s)
      {
          return s.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Length;
      }
      label2.Text = (GetNoOfWords(sentance).ToString());
  </code></pre>
  
  <p>and i can get the number of words in the whole string</p>
  
  <pre><code>    public int CountWord (string text)
      {
          int count = 0;
          for (int i = 0; i &lt; text.Length; i++)
          {
              if (text[i] != ' ')
              {
                  if ((i + 1) == text.Length)
                  {
                      count++;
                  }
                  else
                  {
                      if(text[i + 1] == ' ')
                      {
                          count++;
                      }
                  }
              } 
          }
          return count;
      }
  </code></pre>
  
  <p>then button1</p>
  
  <pre><code>        int words = CountWord(sentance);
          label4.Text = (words.ToString());
  </code></pre>
  
  <p><em>But</em> I can't count how many words are in each sentence.</p>