Escaping with a backslash(\
) works for all characters except a curly brace.
If you are trying to escape a curly brace ({
or }
), you must use {{
or }}
per $ – string interpolation (C# reference)
… All occurrences of double curly braces (“{{“ and “}}”) are converted to a single curly brace.
More Related Contents:
- How to use the ternary operator inside an interpolated string?
- Using C# 6 features with CodeDomProvider (Roslyn)
- How to get ALL child controls of a Windows Forms form of a specific type (Button/Textbox)?
- Calling the base constructor in C#
- Can attributes be added dynamically in C#?
- Detect if deserialized object is missing a field with the JsonConvert class in Json.NET
- Calculate the execution time of a method
- Detect if running as Administrator with or without elevated privileges?
- What is the best way to check for Internet connectivity using .NET?
- Kill child process when parent process is killed
- LINQ to Entities does not recognize the method ‘Double Parse(System.String)’ method, and this method cannot be translated into a store expression
- Remove items from one list in another
- How to make two transparent layer with c#?
- How can I protect my .NET assemblies from decompilation?
- Retrieve current URL from C# windows forms application
- Icecast 2: protocol description, streaming to it using C#
- How can I print the contents of an array horizontally?
- Regex that matches a newline (\n) in C#
- How do I marshal a struct that contains a variable-sized array to C#?
- What is the correct way to compare char ignoring case?
- How can I write a unit test to determine whether an object can be garbage collected?
- How can I generate UUID in C#
- How to detect mouse clicks?
- ASP.net Getting the error “Access to the path is denied.” while trying to upload files to my Windows Server 2008 R2 Web server
- Why is my bound DataGridView throwing an “Operation not valid because it results in a reentrant call to the SetCurrentCellAddressCore function” error?
- .Net DefaultValueAttribute on Properties
- Will #if RELEASE work like #if DEBUG does in C#?
- The component does not have a resource identified by the uri
- Calling an async method from a synchronous method
- Change ComboBox Border Color in Windows Forms