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}"
All the Code Snippets and Samples you need
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}"
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to escape brackets using string.Format in C# and #VB .NET http://t.co/6M7Tv62RaN #csharp #dotnet #visualbasic #pro…
RT @CodeSnippetsNET: How to escape brackets using string.Format in C# and #VB .NET http://t.co/6M7Tv62RaN #csharp #dotnet #visualbasic #pro…