English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
fromCharCode()The method returns a string encoded in the specified UTF-16the string created by the code unit sequence.
Because fromCharCode() is a static method of String, you should always use it asString.fromCharCode(), rather than using it as a method to create a String object.
String.fromCharCode(n1, n2, ..., nN)
String.fromCharCode(65); // 'A'Test and see‹/›
All browsers fully support the fromCharCode() method:
Method | |||||
fromCharCode() | Is | Is | Is | Is | Is |
Parameter | Description |
---|---|
n1, n2, ..., nN | A sequence of numbers, which is a UTF-16Code unit. The range is from 0 to65535Range from (0xFFFF). |
Return value: | A string representing characters, representing the specified unicode number |
---|---|
JavaScript version: | ECMAScript 1 |
Convert multiple UTF-16Value conversion to character:
String.fromCharCode(78,72,79,79,79); // 'w3codebox'Test and see‹/›