3

One of the strings I want to pass into a function contains {0}, which is a placeholder escape character in c#.

What is the correct syntax to get c# to ignore this? i tried encasing it in single quotes ('), but no good

3 Answers3

4

Use this double curly brackets

{{0}}
Omer
  • 5,464
  • 12
  • 58
  • 73
4

Use double curly brackets.

Ex. '{0}' becomes '{{0}}'

msgambel
  • 7,270
  • 4
  • 44
  • 61
Alexander
  • 560
  • 1
  • 6
  • 18
3

You need to escape the curly braces like this:

{{0}}
Ufuk Hacıoğulları
  • 37,060
  • 12
  • 109
  • 152