title: How to create mutlidimensional list for this in C#?
body: <p>I got a table (in file) which I split into blocks by spaces.</p>
  
  <p>I need structure like this:</p>
  
  <pre><code>-----------------------------
  |21|22|23|33|3323|
  |32|32|
  |434433|545454|5454|
  ------------------------------
  </code></pre>
  
  <p>It's more like each row is its own table. How should I do this?</p>
  
  <p>I tried <code>List&lt;List&lt;string&gt;&gt; matrix = new List&lt;List&lt;string&gt;&gt;()</code>; but I can't seem to find a way to work with it.</p>
  
  <p><strong>EDIT</strong> -  can someone tell me what's wrong with this code???? Matrix[0][0] is same as matrix [1][0].. it seems that same row is added to matrix all the time, but I clear it ... </p>
  
  <pre><code>static ArrayList ReadFromFile(string filename)
      StreamReader SR;
      string S;
      string[] S_split;
  
      SR = File.OpenText(filename);
      S = SR.ReadLine();
  
      ArrayList myItems = new ArrayList();
  
      List&lt;List&lt;string&gt;&gt; matrix = new List&lt;List&lt;string&gt;&gt;();
      List&lt;string&gt; row = new List&lt;string&gt;();
  
      while (S != null)
      {
          row.Clear();
          S_split = S.Split(' ');
          for (int i = 1; i &lt; S_split.GetLength(0); i++)
          {
              row.Add(S_split[i]);
              matrix.Add(row);
          }              
  
          S = SR.ReadLine();
      }
      Console.WriteLine(matrix[1][1]);
      SR.Close();
      return myItems;
  }
  </code></pre>