unescape

Summary

Removes prefixed backslashes to produce equivalent escape sequences from the result.

Usage

public string unescape()

Returns

A version of the original string with preceding escape character prefixes (\) removed and equivalent escape sequences produced from the resulting character sequences.

Description

Unescapes the following sequences by removing the preceding backslash (\) character and converting to the equivalent JS++ escape sequence:

Unescaped Escape Sequence Description
\' ' Single quote
\" " Double quote
` ` Grave accent
\ \ Backslash
\/ / Forward slash
\n \n New line
\r \r Carriage return
\t \t Tab
\b \b Backspace
\f \f Form Feed
\v \v Vertical Tab
\0 \0 Null character

Examples

Basic Usage
1
2
3
4
import System;
 
string foobar = "foo\\nbar";
Console.log(foobar.escape()); // "foo\nbar"

Share

HTML | BBCode | Direct Link