How to escape braces (curly brackets) in a format string in .NET

Answer

For you to output foo {1, 2, 3} you have to do something like:

string t ="1, 2, 3";string v =String.Format(" foo {{{0}}}", t);

To output a { you use {{ and to output a } you use }}.

All string Questions

Ask your interview questions on string

Write Your comment or Questions if you want the answers on string from string Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---