Is it possible to do a case insensitive comparison of individual characters?
I tried:
Char.ToLowerInvariant(charA).CompareTo(Char.ToLowerInvariant(charB))
And though it works for the most part, it didn't seem to work for all
locales.
I tried converting the characters to a string and then do a case insensitive
comparison, and this always worked. Unfortunately this comparison is being
called millions of times and converting to a string is terribly inefficient.
Do I have any other options?
Thanks
Christof Nordiek - 25 May 2007 14:03 GMT
> Is it possible to do a case insensitive comparison of individual
> characters? I tried:
[quoted text clipped - 3 lines]
> And though it works for the most part, it didn't seem to work for all
> locales.
Can you say, where it doesn't work?
Since ToLowerInvariant aswell as CompareTo are culture invariant, the result
shouldn't depend on the locale
Christof