Suppose I have a .net Array of strings.
string[] strings = new string[] { \"AbC\", \"123\", \"Xyz\", \"321\" };
If I wanted to see if the a
I personally like this guy's LambdaComparer
, which is really useful for stuff like this:
LINQ Your Collections with IEqualityComparer and Lambda Expressions
Example Usage:
var comparer = new LambdaComparer(
(lhs, rhs) => lhs.Equals(rhs, StringComparison.InvariantCultureIgnoreCase));
var seq = new[]{"a","b","c","d","e"};
Debug.Assert(seq.Contains("A", comparer));