title: LINQ - looping through rows of 2d array
body: <p>I have a 2d string array like this:</p>
  
  <pre><code>string myarr[,] = new string[100,4];
  </code></pre>
  
  <p>And I want to get the number of rows, that contains a value <code>vpp</code> on the 2nd column.</p>
  
  <p>ie, with normal loop I would be doing like this:</p>
  
  <pre><code>int s = 0;
  for(int i=0; i&lt;100; i++)
  {
    if( myarr[i,1] == "vpp" )
    {
      s++;
    }
  }
  </code></pre>
  
  <p>How could we do it using LINQ ?</p>
  
  <p>I  believe, this will iterate through all the elements of the 2d array, instead of row-wise looping:</p>
  
  <pre><code>s = (from string myRow in myarr where myRow  == "vpp"                                       
            select myRow).Count();
  </code></pre>
  
  <p>Am on mobile device(travelling and reading) now since I don't have access to Visual Studio, so I have just typed the codes above.</p>
  
  <p>Thank you</p>