Doing plenty of case-insensitive string comparisons, I end of with lots of lengthy statements like:
myList.FirstOrDefault(
c => string.Equals(
c.InternalName,
internalName,
StringComparison.InvariantCultureIgnoreCase));
What bothers me is the long name of StringComparison.InvariantCultureIgnoreCase
.
I could think of having extension methods and the like to shorten the code I have to write but on the other hand I fear of "obfuscating" my code and thus making it harder to understand.
So my question is:
Is there a "best practice" of having to write less text and still do InvariantCultureIgnoreCase
-style string comparisons?