Mega Code Archive

 
Categories / C# / Collections Data Structure
 

Compare Array

using System; using System.Collections.Generic; using System.Text; using System.Globalization; public class BaseUtility {     public static bool CompareArray<T>(T[] arr1, T[] arr2)     {         if (arr1.Length != arr2.Length) return false;         int len = (arr1.Length < arr2.Length ? arr1.Length : arr2.Length);         for (int i = 0; i < len; ++i)             if (!arr1[i].Equals(arr2[i]))                 return false;         return true;     } }