The following bit of C# code does not seem to do anything:
String str = \"{3}\";
str.Replace(\"{\", String.Empty);
str.Replace(\"}\", String.Empty);
Console
The Replace
method returns a string with the replacement. What I think you're looking for is this:
str = str.Replace("{", string.Empty);
str = str.Replace("}", string.Empty);
Console.WriteLine(str);
I believe that str.Replace returns a value which you must assign to your variable. So you will need to do something like:
String str = "{3}";
str = str.Replace("{", String.Empty);
str = str.Replace("}", String.Empty);
Console.WriteLine(str);
The Replace function returns the modified string, so you have to assign it back to your str
variable.
String str = "{3}";
str = str.Replace("{", String.Empty);
str = str.Replace("}", String.Empty);
Console.WriteLine(str);