URL-Decode

C# / .Net String Escape/Unescape

Result

The Free Online C# / .Net String Escape/Unescape tool replaced the reserved characters in C# / .Net string with corresponding escaped characters to prevent the compiling. You can also convert them back to their original ones.

String Literal

Literal, more specifically, means how you hard-code the strings in C# programs. It consists of two forms.

  • Regular string literals
  • Verbatim string literals

Regular string literals consist of the characters enclosed in the double-quotes. The various characters (\, a carriage return, and line feed) and many others need to be "escaped" to be represented in the string.

Verbatim string literals consist of @ character, followed by the double quote, characters, and closing double-quote character. It allows pretty much anything within them.

C# / .Net String Escape

The following characters are reserved in C# / .Net string and must be "escaped" before using them.

In C# / .Net Escape,

  • Backspace will be converted to \b
  • Form feed will be converted to \f
  • A new line will be converted to \n
  • The carriage return will be converted to \r
  • The double quote will be converted to \"
  • The single quote will be converted to \'
  • The backslash will be converted to \\
  • The horizontal tab will be converted to \t
  • The vertical tab will be converted to \v
  • Null will be converted to \0
  • Alert will be converted to \a

C# / .Net String Unescape

The following characters in the C# / .Net string must be appropriately unescaped and bring them back to the original ones.

In C# / .Net Unescape,

  • \b will be converted to backspace.
  • \f will be converted to form feed.
  • \n will be converted to a newline.
  • \r will be convertedto carriage return.
  • \" will be converted toa double quote.
  • \' will be converted to a single quote.
  • \\ will be converted to backslash.
  • \t will be converted toa horizontal tab.
  • \v will be converted to a vertical tab.
  • \0 will be converted to null.
  • \a will be converted to alert.

How to use the C# / .Net string Escape/Unescape Online tool?

For this, do the following steps.

  • Open the C# / .Net string Escape/Unescape Online tool.
  • You can copy-paste the C# / .Net string.
  • Click on the "Escape" button.
  • The tool replaces the reserved characters in C# / .Net with its corresponding escaped characters.
  • The tool will display the result code in the "Result" section.
  • Please copy the code and paste it into the desired location.
  • You can unescape the C# / .Net escaped string by clicking on the "Un Escape" button.

Do we keep a copy of your source code?

Protecting user trust is our top priority. We do not keep a copy of the source code that the user pastes for the C# / .Net Escape/Unescape process.

Note: We do not keep a copy of the resulted code. Therefore, please copy the resulted code and paste it to the desired location for future use if you are happy and satisfied with the C# Escape/Unescape.