Siebel eScript Language Reference > Siebel eScript Commands > String Objects >

String.fromCharCode() Static Method


This method returns a string created from the character codes that are passed to it as parameters.

Syntax

String.fromCharCode(code1, code2, ... coden)

Parameter
Description

code1, code2, ... coden

Integers representing Unicode character codes

Returns

A new string containing the characters specified by the codes.

Usage

This static method allows you to create a string by specifying the individual Unicode values of the characters in it. The identifier String is used with this static method, instead of a variable name as with instance methods because it is a property of the String constructor. The parameters passed to this method are assumed to be Unicode values. The following line:

var string1 = String.fromCharCode(0x0041,0x0042);

sets the variable string1 to "AB".

Example

The following example uses the decimal Unicode values of the characters to create the string "Siebel". For another example, read offset[] Method.

var seblStr = String.fromCharCode(83, 105, 101, 98, 101, 108);

See Also

Clib.toascii() Method

Siebel eScript Language Reference