Export (0) Print
Expand All
4 out of 5 rated this helpful - Rate this topic

String.fromCharCode Function (JavaScript)

Returns a string from a number of Unicode character values.

String.fromCharCode([code1[, code2[, ...[, codeN]]]]) 
String

Required. The String object.

code1, . . . , codeN

Optional. A series of Unicode character values to convert to a string. If no arguments are supplied, the result is the empty string.

You call this function on the String object rather than on a string instance.

The following example shows how to use this method:

var test = String.fromCharCode(112, 108, 97, 105, 110);
document.write(test);

// Output: plain

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.