[Mono-bugs] [Bug 494940] New: String.Contains returns always true on non empty strings when looking for single chars string of 0xFFFC .NET Difference

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Apr 14 18:47:00 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=494940


           Summary: String.Contains returns always true on non empty
                    strings when looking for single chars string of 0xFFFC
                    .NET Difference
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=285706)
 --> (http://bugzilla.novell.com/attachment.cgi?id=285706)
Test case showing difference in Contains behaviour

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8)
Gecko/2009032711 Ubuntu/8.04 (hardy) Firefox/3.0.8

String.Contains returns always true on non empty strings when looking for
single chars string of 0xFFFC .NET Difference


const char c = (char)0xFFFC;
string testString = "Hello World";
testString.Contains(new string(c, 1)); // returns true on MONO false on .NET

Reproducible: Always

Steps to Reproduce:
1.Run and Compile Attached Test case
2.
3.
Actual Results:  
find.Length = 1
True

Expected Results:  
find.Length = 1
False

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list