How do I display a literal curly brace character when using the String.Format method? The answer is that you need to escape curly brace by using double braces ({{ and }}).
Console.WriteLine($"He asked, \"Is your name {name}?\", but didn't wait for a reply :-{{"); // Output is: // He asked, "Is your name Horace?", but didn't wait for a reply :-{
© 2024 Digcode.com