Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Fast Case Insensitive String Comparisons

Thread Tools

Fast Case Insensitive String Comparisons

Lucian Wischik
Posts: n/a
Jon Skeet [C# MVP] <(E-Mail Removed)> wrote:
>Mark Wilden <(E-Mail Removed)> wrote:
>> Just out of curiosity, did "mail".ToUpper() == "MAIL".ToUpper()?



The issue was that lowercase "i" gets capitalised to U+0130, "Latin
Capital Letter I With Dot Above".

Instead of the more normal U+0049, "Latin Capital Letter I".

I'm curious! Are there any Turks here who can explain Turkish

Reply With Quote
Mark Wilden
Posts: n/a
>> "Jon Skeet [C# MVP]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) om...
>> >
>> > Note that this test is not a culture-safe one. For instance, in Turkey,
>> > I believe (if I remember the bug I had to fix in a system a while ago
>> > that "mail".ToUpper() != "MAIL".

>> Just out of curiosity, did "mail".ToUpper() == "MAIL".ToUpper()?

> Nope

Oh well - I guess it's nobody's business but the Turks'.


Reply With Quote
Jon Skeet [C# MVP]
Posts: n/a
Mark Wilden <(E-Mail Removed)> wrote:
> > Nope

> Oh well - I guess it's nobody's business but the Turks'.

Are you suggesting a history-insensitive comparison?

StringComparer.IgnoreHistory.Equals("Istanbul". "Constantinople")

Next up: a "man" comparison: Man.Triangle > Man.Particle etc?

Jon Skeet - <(E-Mail Removed)> Blog:
If replying to the group, please do not mail me too
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
check file exists with case sensitive on a case insensitive filesystem Xah Lee Perl Misc 4 04-05-2009 11:21 PM
string.indexof case insensitive Guoqi Zheng ASP .Net 4 01-25-2009 02:07 AM
case insensitive find on case sensitive stl map C++ 1 04-06-2007 08:42 PM
Case-insensitive dict, non-destructive, fast, anyone? Ville Vainio Python 11 04-06-2005 06:53 AM
how to case select with case-insensitive string ? Tee ASP .Net 3 06-23-2004 07:40 PM