title: How to get words from a text box
body: <p>In my WPF application I have a text box named: textBox.
  I'm trying to get each individual word from a sentence typed by user in a string array, say arrayWords.
  I found a piece of code on stackOverFlow that counts the number of words but I want to copy each individual word.</p>
  
  <p>Bellow is the code for counting the number of words.</p>
  
  <pre><code>String text = textBox.Text.Trim();
  int wordCount = 0, index = 0;
  
  while (index &lt; text.Length)
  {
       // check if current char is part of a word
       while (index &lt; text.Length &amp;&amp; Char.IsWhiteSpace(text[index]) == false)
          index++;
       wordCount++;
  
      // skip whitespace until next word
      while (index &lt; text.Length &amp;&amp; Char.IsWhiteSpace(text[index]) == true)
          index++;
  }
  </code></pre>