title: Table of strings in C#
body: <p>Is there a way of creating a table with each cell containing a string in C# ?</p>
  
  <p>The closest thing I found is multidimensional arrays <code>string[,] names;</code>, but it seems like its length needs to be defined which is a problem to me.</p>
  
  <p>Here is what my code looks like : </p>
  
  <pre><code>string[] namePost;
  int[] numbPage;
  string post="";
  string newPost;
  int i=0;
  int j=0;
  
  foreach (var line in File.ReadLines(path).Where(line =&gt; regex1.Match(line).Success))
              {
                  newPost = regex1.Match(line).Groups[1].Value;
                  if (String.Compare(newPost, post) == 0)
                  {
                      j = j + 1;
                  }
                  else
                  {
                      namePost[i] = post;
                      numbPage[i] = j;
                      post = newPost;
                      j = 1;
                      i = i + 1;
                  }    
              }
  </code></pre>
  
  <p>Each instance of the <code>for</code> writes the name of the new "post" in a cell of <code>namePost</code>. In the end, the <code>namePost</code> table stores the name of all the posts that are different from one another.</p>
  
  <p>What is the best way to achieve that ?</p>