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 does not work.

The solution is pretty simple: You need to double those curly braces to escape them.
String.Format("function test() {{ return calcSomething({0}); }}", "123");