Is Same for two array - CSharp System

CSharp examples for System:Array Element

Description

Is Same for two array

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from ww  w  . j ava2s . c o m*/

public class Main{
        public static bool IsSame(this Array a, Array b)
        {
            bool result = false;
            if (a.Length == b.Length)
            {
                for (int i = 0; i < a.Length; i++)
                {
                    if (!a.GetValue(i).Equals(b.GetValue(i)))
                    {
                        result = false;
                        break;
                    }
                    result = true;
                }
            }
            return result;
        }
}

Related Tutorials