Escaping Brackets in String.Format is very simple.
To output a { use {{ and to output a } use }}.

String.Format("Bracketstest: {{{0}}}", "Hello"); // outputs: "Bracketstest: {Hello}"
2 thought on “How to escape brackets using string.Format in C# and VB.NET”

Leave a Reply