title: C# Dynamic Array/ index
body: <p>I am creating an array of string[] in my c# program to save location ("name","Position") of a bunch of elements. The problem is any time I had to introduce a new element I have to change the code at several places according to index of elements:</p>
  
  <pre><code>   string[] list = new string[4];
     list[0] = "[ELEMENT #1 NAME],[ELEMENT #1POSITION]";
     list[1] = "[ELEMENT #2 NAME],[ELEMENT #2POSITION]";
     list[2] = "[ELEMENT #3 NAME],[ELEMENT #3POSITION]";
     list[3] = "[ELEMENT #4 NAME],[ELEMENT #4POSITION]";
  </code></pre>
  
  <p>What I am looking for is something like an dynamic array so that I do not have to change the index location every time I introduce/ remove an element from list.</p>