Upper vs Lower Case

Converting to either upper case or lower case in order to do case-insensitive comparisons is incorrect due to “interesting” features of some cultures, particularly Turkey. Instead, use a StringComparer with the appropriate options.

MSDN has some great guidelines on string handling. You might also want to check that your code passes the Turkey test.

EDIT: Note Neil’s comment around ordinal case-insensitive comparisons. This whole realm is pretty murky 🙁

Leave a Comment