substring()

Availability

Flash Lite 1.0.

Usage

substring(string, index, count) 

Operands

string The string from which to extract the new string.

index The number of the first character to extract.

count The number of characters to include in the extracted string, not including the index character.

Description

Function; extracts part of a string. This function is one-based, whereas the String class methods are zero-based.

Example

The following example extracts the first five characters from the string "Hello World":

origString = "Hello World!";
newString = substring(origString, 0, 5);
trace (newString);            // Output: Hello