Are Equal List - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:List

Description

Are Equal List

Demo Code


using System.Text;
using System.Runtime.InteropServices;
using System.Reflection.Emit;
using System.Reflection;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System.Collections;
using System;/*w w w . j  av  a 2s . c  om*/

public class Main{
        public static bool AreEqualList(IList arr1, IList arr2)
        {
            if (arr1 == null || arr2 == null) return false;

            if (arr1.Count != arr2.Count) return false;

            for (int i = 0; i < arr1.Count; i++)
            {
                if (!arr1[i].Equals(arr2[i])) return false;
            }
            return true;
        }
}

Related Tutorials