Array Equals - CSharp System

CSharp examples for System:Array Equal

Description

Array Equals

Demo Code


using System.Text;
using System;/*from   w w w  . ja v  a 2  s .  c  o  m*/

public class Main{
        public static bool ArrayEquals<T>(this T[] @this, T[] @that, Func<T, T, bool> areEqual)
        {
            if (@this.Length == @that.Length)
                for (int i = 0; i < @this.Length; i++)
                    if (!areEqual(@this[i], @that[i]))
                        return false;
            return true;
        }
}

Related Tutorials