Advertisement
Suchiman

Untitled

Jul 26th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. public static bool ArrayEquals<T>(T[] arr1, T[] arr2)
  2. {
  3.     if (Object.ReferenceEquals(arr1, arr2))
  4.     {
  5.         return true;
  6.     }
  7.     if (arr1.Length != arr2.Length)
  8.     {
  9.         return false;
  10.     }
  11.  
  12.     for (int i = 0; i < arr1.Length; i++)
  13.     {
  14.         if (!arr1[i].Equals(arr2[i]))
  15.         {
  16.             return false;
  17.         }
  18.     }
  19.     return true;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement