length()

Availability

Flash Lite 1.0.

Usage

length(expression)

length(variable)

Operands

expression A string.

variable The name of a variable.

Description

String function; returns the number of characters of the specified string or variable name.

Example

The following example returns the length of the string "Hello":

length("Hello");

The result is 5.

The following example validates an e-mail address by checking that it contains at least six characters:

email = "someone@example.com";
if (length(email) > 6) {
    //trace ("email appears to have enough characters to be valid");
}