Comparison of two arrays

Best practices, code snippets for common functionality, examples, and guidelines.
sukhmeet032795
Posts: 9
Joined: Tue Jun 14, 2016 3:26 pm

Comparison of two arrays

Post by sukhmeet032795 » Tue Jun 14, 2016 3:33 pm

Hi,

i have list of arrays. I want to compare the arrays and check if any two of the arrays are equal. I am using C# syntax. So i thought of using SequenceEqual but that is not working and i dont want to compute term by term.

My arrays are of the form -> var recordedArray = dataTable.Rows.ItemArray;

How can i accomplish this?

Thanks a Ton!!!!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Comparison of two arrays

Post by odklizec » Thu Jun 16, 2016 8:33 am

Hi,

What you are asking for is C# related and it can be solved by a simple google search ;) Here are first three results returned by google:
http://stackoverflow.com/a/713355
http://stackoverflow.com/a/3232755
http://www.dotnetperls.com/sequenceequal
Hope these help?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

sukhmeet032795
Posts: 9
Joined: Tue Jun 14, 2016 3:26 pm

Re: Comparison of two arrays

Post by sukhmeet032795 » Fri Jun 17, 2016 5:11 am

Hi,

Thanks for the quick reply. I have already solved it. I was missing reference to System.Core dll which contains the namespace and the function SequenceEqual. So after adding the dll, i wws able to solve it.