title: When I add a new item to a List<List<string>> each item of the parent list get the same values
body: <p>Apologies if the answer to this is obvious, I'm fairly new to C# and OOP. I've stepped though my code and spent quite some time on Google but I can't find the answer to my question (quite possibly because I am using the wrong search terms!). </p>
  
  <p>I have the following class that creates a static <code>List&lt;List&lt;string&gt;&gt;</code> and has a method to add items to that list:</p>
  
  <pre><code>public static class WordList
      {
      static List&lt;List&lt;string&gt;&gt; _WordList; // Static List instance
  
      static WordList()
      {
          //
          // Allocate the list.
          //
          _WordList = new List&lt;List&lt;string&gt;&gt;();
      }
  
      public static void Record(List&lt;string&gt; Words)
      {
          //
          // Record this value in the list.
          //
          _WordList.Add(Words);
      }
  }
  </code></pre>
  
  <p>Else where I create a <code>List&lt;string&gt;</code> which I pass into the <code>Record()</code> method to be added to <code>_WordList</code>. The problem is when I add items to WordList it gives every item in that list the same value. e.g.:</p>
  
  <p>1st item added contains "Foo" and "bar"</p>
  
  <p>2nd item added contains "Not","Foo" and "bar"</p>
  
  <p>So instead of a list that looks like:</p>
  
  <pre><code>1: "Foo","bar"
  2: "Not","Foo","bar"
  </code></pre>
  
  <p>I end up with:</p>
  
  <pre><code>1: "Not","Foo","bar"
  2: "Not","Foo","bar"
  </code></pre>
  
  <p>I haven't used a <code>List&lt;string[]&gt;</code> instead of a <code>List&lt;List&lt;string&gt;&gt;</code> because the way I am getting the <code>List&lt;string&gt;</code> to add is by reading a text file line by line with a delimiter saying when I should add the <code>List&lt;string&gt;</code> and clear it so I can start again. Therefore I don't know how long an array I need to declare.</p>
  
  <p>Hope this makes some kind of sense! If you need anymore of the code posting to help let me know.</p>
  
  <p>Thanks, in advance.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is the code for the creation of the <code>List&lt;string&gt;</code> that is passed to the <code>Record()</code> method. I think I see what people are saying about not creating a new instance of the <code>List&lt;string&gt;</code> but I'm not sure how to remedy this in regards to my code. I will have a think about it and post an answer if I come up with one!</p>
  
  <pre><code>public static void LoadWordList(string path)
      {
          string line;
          List&lt;string&gt; WordsToAdd = new List&lt;string&gt;();
  
          StreamReader file = new System.IO.StreamReader(path);
          while ((line = file.ReadLine()) != null)
          {
              if (line.Substring(0, 1) == "$")
              {
                      WordList.Record(WordsToAdd);
                      WordsToAdd.Clear();
                      WordsToAdd.Add(line.Replace("$", ""));
              }
              else
              {
                  WordsToAdd.Add(line.Replace("_"," "));
              }
          }
          file.Close();
      }
  </code></pre>