Escape Function
Main Menu
Description
Returns a string so it contains only ASCII characters.

Syntax

Escape(charString)

Required. String expression to be encoded.
The Escape function returns a string (in Unicode format) that contains the contents of charString. All spaces, punctuation, accented characters, and other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. Unicode characters that have a value greater than 255 are stored using the %uxxxx format.

The string that the Escape function returns is suitable for transmission with many protocols, such as the HTTP protocol.

The following example shows how Escape function might be used.

Dim MyString, TheEscapeString
MyString = "This is a Example of = Escape()"
TheEscapeString = Escape( MyString )

' TheEscapeString now contains "This%20is%20a%20Example%20of%20%3D%20Escape%28%29"

Note Because the Escape function is not designed to create a valid uniform resource identifier (URI), it should not be used to encode URIs. The JScript encodeURI method may be used to encode URIs.

related to
Unescape


Main Menu