title: Split string into array of words
body: <p>I want to split a <code>string</code> into an array of words without using <code>string.Split</code>. I tried already this code and it is working but cant assign the result into the array</p>
  
  <pre><code>string str = "Hello, how are you?";
  string tmp = "";
  int word_counter = 0;
  for (int i = 0; i &lt; str.Length; i++)
  {
       if (str[i] == ' ')
       {
           word_counter++;
       }
  }
  string[] words = new string[word_counter+1];
  
  for (int i = 0; i &lt; str.Length; i++)
  {
      if (str[i] != ' ')
      {
          tmp = tmp + str[i];
          continue;
      }
      // here is the problem, i cant assign every tmp in the array
      for (int j = 0; j &lt; words.Length; j++)
      {
          words[j] = tmp;
      }
      tmp = "";
  }
  </code></pre>