Siebel eScript Language Reference > Siebel eScript Commands > Conversion Methods >

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 when a string is encoded. Note that the @ and * characters have not been replaced.

var str = escape("@#$*96!");

Results in the following string:   "@%23%24*96%21"

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

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

See Also

unescape(string) Method

Siebel eScript Language Reference