title: C# using TryGetValue after a string split
body: <p>Okay, i've searched <strong>EVERYWHERE</strong> and I'm truly stuck with this.
  I'm trying to create a program which will load a CSV file with text words separated by a comma using a streamreader and then add them into a dictionary. 
  Then on the form if a user types the text before the comma into the first text box and clicks a button then the text after the comma will show in the other text box. </p>
  
  <p>I'm not going to lie, I'm still trying to learn to basics of c# so an explained answer would be appreciated!</p>
  
  <p>This is my code just now and I don't know where to go from here, I want to use a TryGetValue after the comma split to assign the first part of the text as [0] and the second part after the comma as [1]</p>
  
  <pre><code>//Dictionary Load Button
  private void button1_Click_1(object sender, EventArgs e)
  {
      if (openFileDialog1.ShowDialog() == DialogResult.OK) // Allows the user to choose the dictionary to load
      {  
          Dictionary&lt;string, int&gt; d = new Dictionary&lt;string, int&gt;();
          using (StreamReader sr = new StreamReader(openFileDialog1.FileName))
          {
              string line;
              while ((line = sr.ReadLine()) != null)
              {
                  string[] splitword = line.Split(',');
              }
          }
      }
  }
  </code></pre>
  
  <p>an example of my input data is like:</p>
  
  <blockquote>
    <blockquote>
      <p>black, white</p>
      
      <p>cat,dog</p>
      
      <p>yellow, blue</p>
    </blockquote>
  </blockquote>