You can convert both strings to upper case before performing the check:
string1.ToUpperInvariant().Contains(string2.ToUpperInvariant())
Or if you want to take the current culture into account when defining case insesitivity:
string1.ToUpper().Contains(string2.ToUpper())
Or you could even use a specific culture by calling the ToUpper
overload that accepts a CultureInfo
.
The reason that you should convert to upper case and not lower case is described in code analysis warning CA1308: Normalize strings to uppercase:
Strings should be normalized to uppercase. A small group of characters, when they are converted to lowercase, cannot make a round trip. To make a round trip means to convert the characters from one locale to another locale that represents character data differently, and then to accurately retrieve the original characters from the converted characters.
You may wonder what "small group of characters" are affected by this and apparently at least some Georgian scripts have this problem according to Michael S. Kaplan.