Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:String:fromCharCode

From MDC


Contents

[edit] Summary

Returns a string created by using the specified sequence of Unicode values.

Method of String

Static

Implemented in: JavaScript 1.2, NES3.0

JavaScript 1.3: Uses a Unicode value rather than an ISO-Latin-1 value.

ECMA Version: ECMA-262

[edit] Syntax

String.fromCharCode(num1, ..., numN)

[edit] Parameters

num1, ..., numN 
A sequence of numbers that are Unicode values.

[edit] Description

This method returns a string and not a String object.

Because fromCharCode is a static method of String, you always use it as String.fromCharCode(), rather than as a method of a String object you created.

[edit] Backward Compatibility

[edit] JavaScript 1.2

The fromCharCode method returns a string created by using the specified sequence of ISO-Latin-1 codeset values.

[edit] Examples

[edit] Example: Using fromCharCode

The following example returns the string "ABC".

String.fromCharCode(65,66,67)

[edit] See Also

charCodeAt