The length property

Every string has a length property, which is equal to the number of characters in the string:

var str:String = "Adobe";
trace(str.length);            // output: 5

An empty string and a null string both have a length of 0, as the following example shows:

var str1:String = new String();
trace(str1.length);           // output: 0

str2:String = '';
trace(str2.length);           // output: 0

Flash CS3

Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000079.html