Escape curly brace input from form c#
c#
Solution
String is an immutable class. You have to reassign the corrected string back into `str`
str = str.Replace("{","{{");
str = str.Replace("}","}}");
Problem
I know that in order to use curly braces with String.Format, I have to use double curly braces, i.e. "{{" and "}}". My question is, how do I make this work with a string that comes from a form? I've tried ``` str.Replace("{","{{"); str.Replace("}","}}"); ``` But this doesn't seem to work. Any Ideas?