-3

I need to escape the first pair of curly brackets but the second pair or the inner pair should not be escaped.

string.Format("@Neptune.ShowAlert(\{content:{0}\})", ex.Message);

I have tried the above but I get the "Unrecognized escape sequence" error.

Farhad-Taran
  • 6,282
  • 15
  • 67
  • 121
  • http://stackoverflow.com/questions/91362/how-to-escape-brackets-curly-braces-in-a-format-string-in-net – mikey Nov 15 '13 at 14:03

1 Answers1

4

Use {{ and }} to escape the braces.

Igor Ševo
  • 5,459
  • 3
  • 35
  • 80