Github user Chand2048 commented on the pull request:
https://github.com/apache/lucenenet/pull/95#issuecomment-73921349
Here is some amusing sample code to show the problem.
static void Main(string[] args)
{
String s1 = "abc";
String s2 = "abc\0";
Console.WriteLine("'{0}'", s1);
Console.WriteLine("'{0}'", s2);
Console.WriteLine("s1.Equals(s2) returns {0}", s1.Equals(s2));
Console.WriteLine("s1.CompareTo(s2) returns {0}", s1.CompareTo(s2));
Console.WriteLine("string.Compare(s1, s2, StringComparison.Ordinal)
returns {0}", string.Compare(s1, s2, StringComparison.Ordinal));
}
Output is
'abc'
'abc '
s1.Equals(s2) returns False
s1.CompareTo(s2) returns 0
string.Compare(s1, s2, StringComparison.Ordinal) returns -1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---