Microsoft® JScript™ charCodeAt Method | Language Reference Version 3

See Also Applies To

##### Description

> Returns the Unicode encoding of the specified character.

##### Syntax

> stringObj.charCodeAt(index)

> The charCodeAt method syntax has these parts:

> Part | Description
> stringObj | Required. A String object or literal.
> index | Required. The zero-based index of the specified character.

##### Remarks

> If there is no character at the specified index, NaN is returned.

> The following example illustrates the use of the charCodeAt method:

> >     function charCodeAtTest(n)
> >     {
> >       var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> >       var s;
> >       s = str.charCodeAt(n - 1);
> >       // return Unicode character code.
> >       return(s);
> >     }

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.