Compare 2 ArrayLists using C# and tell wether they are same or not

usefull method to compare 2 ArrayLists

private bool CompareArrayLists(ArrayList List1, ArrayList List2)
    {
        if (List1.Count != List2.Count)
            return false;

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

 

Advertisements

About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s