Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Global Functions > length() | |||
Flash Lite 1.0.
length(expression)length(variable)
expression A string.
variable The name of a variable.
String function; returns the number of characters of the specified string or variable name.
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");
}
|
|
|
|