Javascript - String.charCodeAt()

Syntax

string.charCodeAt(num)

Description

The charCodeAt() method of an instance of the String object returns the ISO-Latin-1 number of the character located at the indexed, num, position passed. This indexing is done from left to right starting with the 0(zero) position. If the num passed is not a valid index in the string, -1 is returned.

Example

<script language="JavaScript">
<!--

var myString = new String("abc defg");

document.write(myString.charCodeAt(2)); //result is '99'
document.write(myString.charCodeAt(7)); //result is '103'
document.write(myString.charCodeAt(9)); //result is NaN

//-->
</script>
              
Write a review
Message:
Rating:
Name:
Email:
(optional)
(Your email that entered here will not show anywhere on website and will use only reference when someone reply your post)
  I want to receive a copy of email on this post (your email is needed)
 
Code: