
String.concat() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
807
trace(country.charAt(0)); // Displays: "C" (the first letter)
// This function removes all the spaces from a string and returns the result
function stripSpaces (inString) {
var outString = "";
for (i = 0; i < inString.length; i++) {
if (inString.charAt(i) != " ") {
outString += inString.charAt(i);
}
}
return outString;
}
See Also
String.charCodeAt(), String.indexOf(), String.slice(); “The charAt() function,” in Chapter 4
String.charCodeAt() Method
retrieve the code point of the character at a specific position in a string
Flash 5
string.charCodeAt(index)
Arguments
index The integer position of a character in string, which should be in the range of
0 (the first character) to
string.length – 1 (the last character).
Returns
An integer representing the Unicode code point of the character in the position index
within string. For the code points of the first 256 characters, see Appendix B.
Example
var msg = "A is the first letter of the Latin alphabet.";
trace(msg.charCodeAt(0)); // Displays: 65 (the code point for the "A" character)
trace(msg.charCodeAt(1)); // Displays: 32 (the code point for the space character)
See Also
String.charAt(), String.fromCharCode(); “The charCodeAt() function,” in Chapter 4;
Appendix B
String.concat() Method
combine ...