[Mono-list] Problem with String.Replace

Marcus mathpup@mylinuxisp.com
Sun, 1 Feb 2004 22:50:55 -0500


I did want to point out a bug that I posted to Bugzilla because of its 
potential severity:

When calling String.Replace on a string, the comparison seems to be done 
on a case-insensitive basis. For example, in the test program: 
 
using System; 
 
public class Testing 
{ 
    private static void Main() 
    { 
        string str = "Piggy"; 
        Console.WriteLine( str.Replace( "I", "" ) ); 
    } 
} 
 
 
On Mono in current CVS, it prints "Pggy", but on Mono 0.29 and .NET it prints 
"Piggy". The null-string does not seem to be the culprit itself, since 
str.Replace("G", "t") will turn Piggy into Pitty on mono.