How to

escape curly brace in String.Format

Published: 30. November 2011 | Updated: 30. November 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Strings
Tags: C# Text
Was this snippet helpful for you? YESYES / NONO

Code

string text = String.Format("Escaping {{curly}} brace for the {0}. time", 1);

Console.WriteLine(text);
Console Output:
Escaping {curly} brace for the 1. time
Send us feedback about this snippet »



Related Snippets: