Skip to main content
Post Made Community Wiki by CommunityBot
Source Link
jfs
  • 16.8k
  • 13
  • 64
  • 91

From CLR via C#:

When normalizing strings, it is highly recommended that you use ToUpperInvariant instead of ToLowerInvariant because Microsoft has optimized the code for performing uppercase comparisons.

I remember one time my coworker always changed strings to uppercase before comparing. I've always wondered why he does that because I feel it's more "natural" to convert to lowercase first. After reading the book now I know why.