Split (String.split Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

trace("slice(1,1): "+my_str.slice(1, 1)); // slice(1,1):
trace("slice(3,2): "+my_str.slice(3, 2)); // slice(3,2):
trace("slice(-2,2): "+my_str.slice(-2, 2)); // slice(-2,2):
// slices that omit the end parameter use String.length, which equals 5
trace("slice(0): "+my_str.slice(0)); // slice(0): Lorem
trace("slice(3): "+my_str.slice(3)); // slice(3): em
An example is also in the Strings.fla file in the ActionScript samples folder. The following list
gives typical paths to this folder:
Windows: boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript
Macintosh: Macintosh HD/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/ActionScript
See also
substr (String.substr method)

split (String.split method)

public split(delimiter:String, [limit:Number]) : Array
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 ("") as a
delimiter, each character in the string is placed as an element in the array.
If the
parameter is undefined, the entire string is placed into the first element of
delimiter
the returned array.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A string; the character or string at which
delimiter:String
[optional] - The number of items to place into the array.
limit:Number
Returns
- An array containing the substrings of
Array
,
substring (String.substring method)
.
my_str
delimiter
splits.
my_str
String
635

Advertisement

Table of Contents
loading

Table of Contents