title: (C#) - store each word between Split in an array
body: <p>lets say that was the text in the file. it would remove the colons, and put each word into it's own string in an array. for example:</p>
  
  <pre><code>exampleArray[0] = 'hello' 
  exampleArray[1] = 'my'
  exampleArray[2] = 'name'
  exampleArray[3] = 'is'
  exampleArray[4] = 'lavi'
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>private void button2_Click(object sender, EventArgs e)
      {
          listBox1.Items.Clear();
          OpenFileDialog ofd = new OpenFileDialog();
          ofd.Filter = "Text Files|*.txt";
          DialogResult result = ofd.ShowDialog();
  
          if(result == DialogResult.OK)
          {
              StreamReader textfile = new StreamReader(ofd.FileName); 
  
              string s = textfile.ReadToEnd();
  
              string[] split = s.Split(':', '\n');
  
              foreach (string word in split)
                  textBox1.Text = word[0].ToString();
                  //listBox1.Items.Add(word);
  
  
              ofd.Dispose();
          }
  </code></pre>
  
  <p>thanks!</p>
  
  <p><strong>edit:</strong> What I meant to say is how do I make it so each word is stored in an array so I can access it later with [0], [1], [2], etc.? If Split does that automatically, how do I access each word?</p>