Use contains with InvariantCultureIgnoreCase function c#

Viewed 1489

I'm trying to populate all the results that contains the letters provided by the user.

foreach (var item in entries.PhonebookList.Where(ab => ab.FirstName.Contains(fName, StringComparison.InvariantCultureIgnoreCase)))
{
    Console.WriteLine("Record: {0}  {1}  {2} ", item.ItemNumber, item.FirstName, item.LastName);
}

But I'm getting an error inside the Contains method.

"No overload for method 'Contains' takes 2 arguments"

What is the best way to use Contains with StringComparison.InvariantCultureIgnoreCase method?

Thank you.

2 Answers
Related