CompareWith
Last updated
Was this helpful?
Last updated
Was this helpful?
Compares two collections using the given comparison function, element by element.
Returns the first non-zero result from the comparison function.
WARNING
This function causes evaluation.
Parameters
Returns
Func<T, T, int > comparer
IEnumerable<T> source1
IEnumerable<T> source2
int
The comparer
function must receive an element of each collection and returns an integer value related to this comparison.
This function was inspired by .
Comparing two different collections
Comparing two different collections and getting the difference
It is important to notice that, the result is 42
because the first subtraction returns 0
.