| Start |
|---|
| Escaping special symbols in string literals Backslash The second example uses a verbatim string literal (opens new window), which doesn't treat the backslash as an escape character. Quotes Both variables will contain the same text. "Hello World!", said the quick brown fox. Newlines Verbatim string literals can contain newlines: Both variables will contain the same text. |
Unicode character escape sequences |
| Escaping special symbols in character literals Apostrophes Backslash |
| Using escape sequences in identifiers Escape sequences are not restricted to Suppose you need to override a third-party method: and suppose the character and the C# compiler will know (However, it might be a good idea to switch to UTF-8 or a similar encoding that can handle all characters.) |
| Unrecognized escape sequences produce compile-time errors The following examples will not compile: Instead, they will produce the error Syntax
RemarksString escape sequences are transformed to the corresponding character at compile time. Ordinary strings that happen to contain backwards slashes are not transformed. For example, the strings |
Read Article
https://develop.horje.com/learn/1434/reference