string.ToLower() and string.ToLowerInvariant()

Depending on the current culture, ToLower might produce a culture specific lowercase letter, that you aren’t expecting. Such as producing ınfo without the dot on the i instead of info and thus mucking up string comparisons. For that reason, ToLowerInvariant should be used on any non-language-specific data. When you might have user input that might be in their native language/character-set, would generally be the only time you use ToLower.

See this question for an example of this issue:
C#- ToLower() is sometimes removing dot from the letter “I”

Leave a Comment