MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 651

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Description
Method; returns the character in the position specified by the parameter
number from 0 to
This method is similar to
a 16-bit integer character code.
Example
In the following example, this method is called on the first letter of the string
my_str = new String("Chris");
i = my_str.charCodeAt(0); // i = "C"
String.charCodeAt()
Availability
Flash Player 5.
Usage
my_str.charCodeAt(index)
Parameters
An integer that specifies the position of a character in the string. The first character is
index
indicated by
and the last character is indicated by
0,
Returns
An integer.
Description
Method; returns a 16-bit integer from 0 to 65535 that represents the character specified by
. If
index
index
This method is similar to
character code, not a character.
Example
In the following example, this method is called on the first letter of the string
my_str = new String("Chris");
i = my_str.charCodeAt(0); // i = 67
- 1, an empty string is returned.
string.length
String.charCodeAt()
is not a number from 0 to
String.charAt()
except that the returned value is a character, not
my_str.length
- 1,
string.length
NaN
except that the returned value is a 16-bit integer
. If
is not a
index
index
.
"Chris"
- 1.
is returned.
.
"Chris"
String.charCodeAt()
651

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents