Groups | Blog | Home
all groups > dotnet internationalization > november 2005 >

dotnet internationalization : This Fails? Assert(CaseInsensitiveComparer.DefaultInvariant.Equals('abc', 'ABC'))



steventhrasher42 NO[at]SPAM hotmail.com
11/4/2005 12:32:57 PM
Can anybody duplicate this problem and/or explain to me why this
assertion might be failing for me? Seems pretty straightforward to me
that it should succeed, but I must be missing something.

Assert(CaseInsensitiveComparer.DefaultInvariant.Equals('abc', 'ABC'))

Thanks!
steventhrasher42 NO[at]SPAM hotmail.com
11/4/2005 1:29:44 PM
Sorry, the code is written in Delphi, but I didn't state that. If
you're using C#, use double quotes.

So, any ideas? This a DotNet bug? It would be hard to believe, but
like I said, seems pretty obvious that it should be working.
schneider
11/4/2005 3:08:01 PM
Need to use Double quotes "" not '

Schneider

[quoted text, click to view]

Nicole Calinoiu
11/9/2005 8:52:22 AM
CaseInsensitiveComparer does not override the Equals method, so the
reference comparison implemented by the Object type is what your code is
actually using. If you want to compare the string contents, use the Compare
method instead.



[quoted text, click to view]

AddThis Social Bookmark Button