Regex.Unescape(String) Method

Definition

Converts any escaped characters in the input string.

public:
 static System::String ^ Unescape(System::String ^ str);
public static string Unescape(string str);
static member Unescape : string -> string
Public Shared Function Unescape (str As String) As String

Parameters

str
String

The input string containing the text to convert.

Returns

A string of characters with any escaped characters converted to their unescaped form.

Exceptions

str includes an unrecognized escape sequence.

str is null.

Remarks

The Unescape(String) method reverses the transformation performed by the Escape(String) method by removing the escape character ("\") from each escaped character. It also unescapes hexadecimal values in verbatim string literals, converting them to the actual printable characters (for example, \x07 becomes \a).

Applies to

See also