title: Find and/or Access values in a C# List container
body: <p>I did find some solutions related to this problem but it's still not working for me. </p>
  
  <p>I have a list of integer arrays "numbers" that has some integer sequences as follows:</p>
  
  <pre><code>        List&lt;int[]&gt; numbers;
          numbers = new List&lt;int[]&gt;();
          numbers.Add(new int[] { 0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14 }); // 0
          numbers.Add(new int[] { 1, 4, 7, 10, 13 }); // 1
          numbers.Add(new int[] { 0, 1, 2, 5, 6, 7, 8, 9, 12, 13, 14 }); // 2
  </code></pre>
  
  <p>Then, after processing some data I will get a targeted sequence "MyList":</p>
  
  <pre><code>for (int i = 0; i &lt; 5; i++ ){
                  for(int j = 0; j &lt; 3; j++){
                      if (TempImg.Data[i, j, 0] == 0)
                          MyList.Add(k);
                      k++;}}
  </code></pre>
  
  <p>Then, I want to check if this targeted sequence is within my original List "numbers". I convert it first to an integer array "results" as follows:</p>
  
  <pre><code>int[] results = MyList.ToArray&lt;int&gt;();
  </code></pre>
  
  <p>and then tend to find it in the list as follows:</p>
  
  <pre><code>        k = numbers.IndexOf(results);
          Console.WriteLine(k);
  </code></pre>
  
  <p>the output is (-1) but NOT the actual index of the matching sequence. </p>
  
  <p>-1 means not found, while when I display it to the console I find that it's the exact matching sequence ..  I would love to know why it's not working..</p>
  
  <p>I also tried to do this to iterate the original list and find the matching sequence then display its index. But also didn't work:</p>
  
  <pre><code>        //for (int i = 0; i &lt; numbers.Count(); i++)
          //{
          //    if (results == numbers[i])
          //        Console.WriteLine(i);
          //}
  </code></pre>
  
  <p>Thank you much</p>