I’ve been writing code full-time in C# for about 4 years now but every once in a while someone shows me something totally new. Last week, one of the devs on my team showed me an override of String.Equals() that does a case-insensitive compare. It kinda blew my mind that I’d never seen that before.
The following line of code evaluates to true.
string.Equals(“string number 1”, “String NUMBER 1”, StringComparison.CurrentCultureIgnoreCase)
There is also a similar override of String.Compare().
Pretty handy, huh?