| Character | C# Escape | Unicode | Description |
|---|---|---|---|
| " | \" | \u0022 | Double quote |
| ' | \' | \u0027 | Single quote |
| \ | \\ | \u005C | Backslash |
| newline | \n | \u000A | Line feed |
| tab | \t | \u0009 | Horizontal tab |
| carriage return | \r | \u000D | Carriage return |
| null | \0 | \u0000 | Null character |
| vertical tab | \v | \u000B | Vertical tab |
C# string escaping is the process of adding backslashes before special characters in C# string literals to ensure they are interpreted correctly by the C# compiler. This is essential for .NET development when working with strings that contain quotes, backslashes, or control characters.
Why C# string escaping is important:
C# supports several escape sequences including \" for double quotes, \' for single quotes, \\ for backslashes, \n for newlines, \t for tabs, \0 for null characters, and \uXXXX for Unicode characters. C# also supports verbatim strings (@"...") which disable escape sequence processing. Our tool handles all standard C# escape sequences for regular string literals.