JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow String Right Arrow fromCharCode()

fromCharCode()  String  class method

Description

Returns a string created from the specified sequence of Unicode values.

  • Like all class methods fromCharCode() should be used on the class rather than an instance of the class.

Syntax


Signature Description
String.fromCharCode(unicodeVal1, ..., unicodeValN)Returns a string created from the specified sequence of Unicode values.

Parameters


Parameter Description
unicodeVal1, ..., unicodeValN)A sequence of Unicode values to form the string from.

Examples

The code below creates a string from some unicode values.


// Create string variable from unicode values.
var aString = String.fromCharCode(97, 98, 99, 100);
// Display string.
alert('String contains: ' + aString);

Press the button below to action the above code:

Related Tutorials

JavaScript Basic Tutorials - Lesson 8 - Strings



  

go to home page Homepage go to top of page Top