[Mono-bugs] [Bug 56985][Wis] New - Error in String.Replace()

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 14 Apr 2004 08:10:29 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mono-bug@jerryweb.info.

http://bugzilla.ximian.com/show_bug.cgi?id=56985

--- shadow/56985	2004-04-14 08:10:29.000000000 -0400
+++ shadow/56985.tmp.10259	2004-04-14 08:10:29.000000000 -0400
@@ -0,0 +1,53 @@
+Bug#: 56985
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mono-bug@jerryweb.info               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error in String.Replace()
+
+Error in String.Replace()
+
+Steps to reproduce the problem:
+Compile and run the following code
+============================================================
+using System;
+using System.Xml;
+
+namespace Test {
+   class TestClass {
+      static void Main() {
+         char ch1 = (char) 32;
+         char ch2 = (char) 160;
+         string s1 = new string(ch1, 1);
+         string s2 = new string(ch2, 1);
+
+         Console.WriteLine("(int) s1[0] = {0}", (int) s1[0]);
+         Console.WriteLine("(int) s2[0] = {0}", (int) s2[0]);
+
+         string s3 = s1.Replace(s2, "abc");
+         Console.WriteLine("s1.Replace(s2, \"abc\"): {0};", s3);
+         s3 = s2.Replace(s1, "def");
+         Console.WriteLine("s2.Replace(s1, \"def\"): {0};", s3);
+         Console.WriteLine("s1.Equals(s2): {0}", s1.Equals(s2));
+      }
+   }
+}
+============================================================
+
+Actual Results in Mono (CVS, 2003-02-12), Gentoo Linux
+(int) s1[0] = 32
+(int) s2[0] = 160
+s1.Replace(s2, "abc"): abc;
+s2.Replace(s1, "def"): def;
+s1.Equals(s2): False