I have code that ignores common words from user input:
string[] ignored_words = { "the", "and", "I" };
String[] words = UserInput.Split(' ');
foreach (string word in words)
{
if (!ignored_words.Any(word.Equals))
{
// perform actions on desired words only
}
}
This works great, unless the case is wrong ("THE" as user input will not be caught by the "the" ignored word).
How can I add an IgnoreCase clause to the Equals comparison?