about learning and improving skills
.NET
Curly braces in C# String.Format()
Jul 23rd
Ever wanted to use String.Format on, say, a javascript function? Those include curly braces ( { or } ), but those curly braces are reserved as placeholder marker in String.Format() (i.e. for {0}). Escaping the braces with a backslash (comes to mind first in C#) does not work, though.
The solution is pretty simple: You need to double those curly braces to escape them:
String.Format("function test() {{ return calcSomething({0}); }}", "123");