Given a class with the following definition:
public class MyTestClass
{
public int ValueA { get; set; }
public int ValueB { get; set; }
}
How can duplicate values be found in a MyTestClass[] array?
For example,
MyTestClass[] items = new MyTestClass[3];
items[0] = new MyTestClass { ValueA = 1, ValueB = 1 };
items[1] = new MyTestClass { ValueA = 0, ValueB = 1 };
items[2] = new MyTestClass { ValueA = 1, ValueB = 1 };
Contains a duplicate as there are two MyTestClass objects where ValueA and ValueB both = 1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…