title: Escape curly braces in string.Format or string interpolation and a format specifier
body: <p>I have encountered a curious problem with string interpolation (also happens with string.Format).</p>
  
  <p>I want to create a string in the form of {x} where x is any number. I know how to escape curly braces, and it works as intended, but only if I don't add a format specifier. I can "fix" it by adding a space between the first closing brace, but that changes the output string.</p>
  
  <pre><code>int i = 5
  string a = $"{{{i}}}";    // creates {5}
  string b = $"{{{i:D} }}"; // creates "{5 }"
  string c = $"{{{i:D}}}";  // this is what I want, but creates "{D}", not "{5}" because the first two closing braces are interpreted as one escaped one and D} is interpreted as a custom format string
  </code></pre>
  
  <p>Is there a clean way to do this? (i.e. without hacks using Regex.Replace, or adding additional placeholders in the form of <code>$"{{{i:D}{"}"}"</code>)</p>