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

Omer
  • 8,194
  • 13
  • 74
  • 92

3 Answers3

4

Use this double curly brackets

{{0}}
Omer
  • 8,194
  • 13
  • 74
  • 92
4

Use double curly brackets.

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

msgambel
  • 7,320
  • 4
  • 46
  • 62
Alexander
  • 612
  • 1
  • 9
  • 20
3

You need to escape the curly braces like this:

{{0}}
Ufuk Hacıoğulları
  • 37,978
  • 12
  • 114
  • 156