title: Compare two .NET Array objects
body: <p>I am trying to compare two .NET arrays. Here is an obvious implementation for comparing arrays of bytes:</p>
  
  <pre><code>bool AreEqual(byte[] a, byte[] b){
      if(a.Length != b.Length)
          return false;
      for(int i = 0; i &lt; a.Length; i++)
          if(a[i] != b[i])
              return false;
  
      return true;
  }
  </code></pre>
  
  <p>A more refined approach can be seen <a href="http://blogs.msdn.com/kathykam/archive/2006/03/08/array-equals.aspx" rel="nofollow noreferrer">here</a> (via Google).</p>
  
  <ol>
  <li>What is the simplest way (using less
  code but readable) to compare two
  .NET arrays?</li>
  <li>What is the most efficient way
  compare two .NET arrays?</li>
  </ol>