See also
String.substr()
String.split()
Availability
Flash Player 5.
Usage
my_str.split("delimiter", [limit])
Parameters
The character or string at which
delimiter
The number of items to place into the array. This parameter is optional.
limit
Returns
An array containing the substrings of
Description
Method; splits a String object into substrings by breaking it wherever the specified
parameter occurs, and returns the substrings in an array. If you use an empty string (
delimiter, each character in the string is placed as an element in the array, as in the following code.
my_str = "Joe";
i = my_str.split("");
trace (i);
The Output panel displays the following:
J,o,e
If the
delimiter
returned array.
Example
The following example returns an array with five elements.
my_str = "P, A, T, S, Y";
my_str.split(",");
This example returns an array with two elements,
my_str.split(",", 2);
,
String.substring()
my_str
parameter is undefined, the entire string is placed into the first element of the
splits.
my_str
.
and
.
"P"
"A"
delimiter
) as a
""
String.split()
655
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?