How use {} in format string?

  • Thread starter Thread starter Alexander Vasilevsky
  • Start date Start date
A

Alexander Vasilevsky

This example
string.Format("{ {0} }", "bla-bla-bla");

throw System.FormatException with message 'Input string was not in a correct
format.'


http://www.alvas.net - Audio tools for C# and VB.Net developers
 
This example
string.Format("{ {0} }", "bla-bla-bla");

throw System.FormatException with message 'Input string was not in a correct
format.'

Double the braces:

string.Format("{{ {0} }}", "bla-bla-bla")

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top