Is there a built-in way to compare IEnumerable<T> (by their elements)?

Posted by Cristi Diaconescu on Stack Overflow See other posts from Stack Overflow or by Cristi Diaconescu
Published on 2010-05-11T14:52:59Z Indexed on 2010/05/11 15:04 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

I would like to compare lists of elements of a given type, to see which list is "bigger".

new BuiltInComparer<IEnumerable<int>>().Compare(
    new[] {1,2}, 
    new[] {1,2,3})

...would return -1

new BuiltInComparer<IEnumerable<int>>().Compare(
    new[] {1,2,3}, 
    new[] {1,2,3})

...would return 0 etc

Is there any such built in comparer?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET