The length property

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

var str:String = "macromedia";
trace(str.length);            // 10

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);           // 0

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

Flex 2.01

Take a survey