JavaScript string object the fromCharCode method primer instance (for converting Unicode values to strings)

  • 2020-03-30 04:09:17
  • OfStack

JavaScript fromCharCode method

The fromCharCode method is used to convert one or more Unicode values to (uppercase) strings and return that string. The syntax is as follows:


String.fromCharCode( num1, num2, ... )

Parameter description:

parameter instructions
num1/num2 A necessity. Unicode Code value

Tip: this method is a static method of String, and its syntax should be string.fromcharcode (), not for String objects you create yourself.

Instance of the fromCharCode method


<script language="JavaScript">
document.write(String.fromCharCode(106,98,53,49).toLowerCase());
</script>

Run the example and output:


jb51

For common character Unicode values, see article (link: #).


Related articles: