Flash CS3 Documentation |
|||
| Flash Lite 2.x ActionScript Language Reference > ActionScript classes > String | |||
Object
|
+-String
public class String
extends Object
The String class is a wrapper for the string primitive data type, and provides methods and properties that let you manipulate primitive string value types. You can convert the value of any object into a string using the String() function.
All the methods of the String class, except for concat(), fromCharCode(), slice(), and substr(), are generic, which means the methods call toString() before performing their operations, and you can use these methods with other non-String objects.
Because all string indexes are zero-based, the index of the last character for any string x is x.length - 1.
You can call any of the methods of the String class using the constructor method new String or using a string literal value. If you specify a string literal, the ActionScript interpreter automatically converts it to a temporary String object, calls the method, and then discards the temporary String object. You can also use the String.length property with a string literal.
Do not confuse a string literal with a String object. In the following example, the first line of code creates the string literal first_string, and the second line of code creates the String object second_string:
var first_string:String = "foo"
var second_string:String = new String("foo")
Use string literals unless you specifically need to use a String object.
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
An integer specifying the number of characters in the specified String object. |
Properties inherited from class Object constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)
|
Signature |
Description |
|---|---|
|
Creates a new String object. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
Returns the character in the position specified by the parameter |
|
|
|
charCodeAt |
Returns a 16-bit integer from 0 to 65535 that represents the character specified by |
|
|
Combines the value of the String object with the parameters and returns the newly formed string; the original value, |
|
|
|
fromCharCode |
Returns a string comprising the characters represented by the Unicode values in the parameters. |
|
|
Searches the string and returns the position of the first occurrence of |
|
|
|
lastIndexOf |
Searches the string from right to left and returns the index of the last occurrence of |
|
|
Returns a string that includes the |
|
|
|
Splits a String object into substrings by breaking it wherever the specified |
|
|
|
Returns the characters in a string from the index specified in the |
|
|
|
Returns a string comprising the characters between the points specified by the |
|
|
|
toLowerCase |
Returns a copy of the |
|
|
Returns an object's properties as strings regardless of whether the properties are strings. |
|
|
|
toUpperCase |
Returns a copy of the String object, with all lowercase characters converted to uppercase. |
|
|
Returns the string. |
Methods inherited from class Object
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00005449.html