Borrowing from the example here, I tried to do the following:
List<string> animals = new List<string> { "Horse", "Cat", "Dog" };
bool testCase = animals.Contains("horse", StringComparer.CurrentCultureIgnoreCase);
But just doing that, I get "No overload for method 'Contains' takes 2 arguments".
I also tried it as:
List<string> animals = new List<string> { "Horse", "Cat", "Dog" };
string testAnimal = "horse";
bool testCase = animals.Contains(testAnimal, StringComparer.CurrentCultureIgnoreCase);
testCase = animals.Contains((string)testAnimal, StringComparer.CurrentCultureIgnoreCase);
But both of those get the same error.
what am I missing here?