Section 24.163. String.charCodeAt( ): get the nth character code from a string


24.163. String.charCodeAt( ): get the nth character code from a string

ECMAScript v1

24.163.1. Synopsis

string.charCodeAt(n)

24.163.1.1. Arguments

n

The index of the character whose encoding is to be returned.

24.163.1.2. Returns

The Unicode encoding of the nth character within string. This return value is a 16-bit integer between 0 and 65535.

24.163.2. Description

charCodeAt( ) is like charAt( ), except that it returns the character encoding at a specific location, rather than returning a substring that contains the character itself. If n is negative or greater than or equal to the string length, charCodeAt( ) returns NaN.

See String.fromCharCode( ) for a way to create a string from Unicode encodings.

24.163.3. See Also

String.charAt( ), String.fromCharCode( )




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net