Siebel eScript Language Reference > Siebel eScript Commands > The Global Object >

escape() Method


The escape() method receives a string and replaces special characters with escape sequences.

Syntax

escape(string)

Parameter
Description
string
The string containing characters to be replaced

Returns

A string with special characters replaced by Unicode sequences.

Usage

The escape() method receives a string and replaces special characters with escape sequences, so that the string may be used with a URL. The escape sequences are Unicode values. For characters in the standard ASCII set (values 0 through 127 decimal), these are the hexadecimal ASCII codes of the characters preceded by percent signs.

Uppercase and lowercase letters, numbers, and the special symbols @ * + _ . / remain in the string. Other characters are replaced by their respective Unicode sequences.

Example

The following code provides an example of what occurs once a string has been encoded. Note that the @ and * characters have not been replaced.

var str = "@#$*96!";

Would result in the following string:   "@#$*%!"

var encodeStr = encode("@#$*%!");

Would result in the following string:   "@%23%24*%25%21"

See Also

unescape(string) Method


 Siebel eScript Language Reference 
 Published: 18 April 2003