When I’m comparing two strings case-insensitively, I use:
if (s1.Equals(s2, StringComparison.InvariantCultureIgnoreCase)) ...
I’d like to shorten this statement throughout my code as the String.Comparison.InvariantCultureIgnoreCase is pretty verbose especially if you have to do multiple comparisons.
Is there a way to alias this so its picked up throughout an entire MVC project?
(I also have external classes I’d have to add this alias too)
You can write an extension method for it.