![MACROMEDIA Flash Lite 2 Скачать руководство пользователя страница 635](http://html1.mh-extra.com/html/macromedia/flash-lite-2/flash-lite-2_reference_687553635.webp)
String
635
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)
,
substring (String.substring method)
split (String.split method)
public split(delimiter:
String
, [limit:
Number
]) : Array
Splits a String object into substrings by breaking it wherever the specified
delimiter
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
delimiter
parameter is undefined, the entire string is placed into the first element of
the returned array.
Availability:
ActionScript 1.0; Flash Lite 2.0
Parameters
delimiter
:
String
- A string; the character or string at which
my_str
splits.
limit
:
Number
[optional] - The number of items to place into the array.
Returns
Array
- An array containing the substrings of
my_str
.
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...