opensubscriber
   Find in this group all groups
 
Unknown more information…

a : advanced-dotnet@discuss.develop.com 5 September 2008 • 10:17PM -0400

[ADVANCED-DOTNET] String.Compare seems to fail when it should not
by Ryan Heath

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,

See following snippet,

if (0 != string.Compare(str1, str2, StringComparison.OrdinalIgnoreCase))
{
  throw new Exception("Compare failed str1:({0}) length:{1} str2:({2})
length:{3}", str1, str1.Length, str2, str2.Length);
}

it throws, for instance, with "Compare failed str1:(-mylife) length:7
str2:(-MYLIFE) length:7"

Obviously something is really wrong here...
Has anyone seen this behavior before, or has anyone some tips how to
investigate this problem?

// Ryan

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.