I'm using the following line of code to match search word in my data list. But Contains is case-sensitive if I search for "search" it doesn't match with "Search" or "seArch".
What are my alternatives to Contains? How Can I replace it with IndexOf?
IEnumerable<Compound> allCompounds = _context.Compounds.ToList();
IEnumerable<Compound> filteredCompounds;
if (!string.IsNullOrEmpty(param.sSearch))
{
filteredCompounds = allCompounds
.Where(c => c.CompoundName.Contains(param.sSearch)
||
c.RI.Contains(param.sSearch)
||
c.MolecularWeight.Contains(param.sSearch)
||
c.MolecularFormula.Contains(param.sSearch)
);
}