The string is immutable; You cannot change an instance of a string. Your two calls to Replace () do nothing with the original string; they return the modified string. Instead, you want:
String str = "{3}";
str = str.Replace("{", String.Empty);
str = str.Replace("}", String.Empty);
Console.WriteLine(str);
It also works in Java.