title: Getting the first element in a string array which is inside a arraylist. C# ASP.net
body: <p>In one of my web application page, I have a C# code as follows. How do I get the first element in the string array inside the arraylist?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>    protected void Button3_Click(object sender, EventArgs e)
      {
          //Array test[9] = new Array();
          ArrayList list = new ArrayList();
  
  
          list.Add(new string[] { "1", "Test1", "20", "30" });
          list.Add(new string[] { "2", "Test2", "5", "30" });
          list.Add(new string[] { "3", "Test3", "10", "30" });
          list.Add(new string[] { "4", "Test4", "20", "30" });
          list.Add(new string[] { "5", "Test5", "0", "30" });
          list.Add(new string[] { "6", "Test6", "15", "30" });
          list.Add(new string[] { "7", "Test7", "10", "30" });
          list.Add(new string[] { "8", "Test8", "20", "30" });
          list.Add(new string[] { "9", "Test9", "30", "30" });
  
          LabelMessages.Text = "Number of Items: " + list.Count + " Item 1 record 1: " + list[1];
  
  
      }
  </code></pre>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>Number of Items: 9 Item 1 record 1: 1
  </code></pre>
  
  <p><strong>Current Output (which is not what I want)</strong></p>
  
  <pre><code>Number of Items: 9 Item 1 record 1: System.String[]
  </code></pre>
  
  <p>So, suppose that the following code:</p>
  
  <pre><code>list.Add(new string[] { "1", "Test1", "20", "30" });
  </code></pre>
  
  <p>is change to:</p>
  
  <pre><code>list.Add(new string[] { "Test1", "20", "30" });
  </code></pre>
  
  <p>then the expected output should be:</p>
  
  <pre><code>Number of Items: 9 Item 1 record 1: Test1
  </code></pre>