STRESCAPE

Purpose:

Converts special "escape" characters in a string.

Syntax:

STRESCAPE("string")

"string"

-

A string.

Returns:

A string.

Example:

fopen("TEST.TXT","w+")

 

fputs(strcat("This will display", strescape("\n"), "two lines.", strescape("\n")), "TEST.TXT")

 

fclose("TEST.TXT")

 

viewfile("TEST.TXT")

 

The is evaluated as a carriage return when the string is written to a file.

Remarks:

The following escape sequences are recognized:

 

\n

newline

\t

tab

\b

backspace

\r

carriage return

\f

form feed

\\

backslash

\'

single quote

\ddd

bit pattern

\uxxxx

UTF16 character

\Uxxxxxxxx

UTF32 character

 

Unicode strings are supported both as direct characters and as escaped strings. For example:

 

p = "αβγδ";

q = strescape("\u03b1\u03b2\u03b3\u03b4");

 

In the first case, the Unicode string is specified directly.

 

In the second case, the Unicode string is specified as an escaped sequence of UTF16 values in the form \uxxxx. UTF32 characters have the form \Uxxxxxxxx.

 

The forward single quote character, the ` character under the ~ key, delimits escaped strings. The following strings are equivalent:

 

p = "αβγδ";

q = strescape("\u03b1\u03b2\u03b3\u03b4");

r = `\u03b1\u03b2\u03b3\u03b4`;

See Also:

CHARSTR

CHARSTRS

SPRINTF

STRCAT