Is there a C# case insensitive equals operator?
I know that the following is case sensitive: if (StringA == StringB) { So is there an operator which will compare two strings in an insensitive manner? Try this: string.Equals(a, b, StringComparison.CurrentCultureIgnoreCase); The best way to compare 2 strings ignoring the case of the letters is to use the String.Equals static method specifying an ordinal ignore case string comparison. This is also the fastest way, much faster than converting the strings to lower or upper case and comparing them after that. I tested the performance of both approaches and the ordinal ignore case string