Section 24.165. String.fromCharCode( ): create a string from character encodings


24.165. String.fromCharCode( ): create a string from character encodings

ECMAScript v1

24.165.1. Synopsis

 String.fromCharCode(c1, c2, ...) 

24.165.1.1. Arguments

c1, c2, ...

Zero or more integers that specify the Unicode encodings of the characters in the string to be created.

24.165.1.2. Returns

A new string containing characters with the specified encodings.

24.165.2. Description

This static method provides a way to create a string by specifying the individual numeric Unicode encodings of its characters. Note that as a static method, fromCharCode( ) is a property of the String( ) constructor and is not actually a method of strings or String objects.

String.charCodeAt( ) is a companion instance method that provides a way to obtain the encodings of the individual characters of a string.

24.165.3. Example

 // Create the string "hello" var s = String.fromCharCode(104, 101, 108, 108, 111); 

24.165.4. See Also

 String.charCodeAt( ) 




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net