If user want to find out number of characters in a string. In this case String has a length property that return the number of characters in the specified String object.
If user want to find out number of characters in a string. In this case String has a length property that return the number of characters in the specified String object.String Length property example in Action Script3:-
If user want to find out number of characters in a string. In this case String has a length property that return the number of characters in the specified String object. In case of string null and empty, the string length is 0.
Example:-
|
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s=" library://ns.adobe.com/flex/spark"xmlns:mx=" library://ns.adobe.com/flex/mx" creationComplete="init();"> <fx:Script><![CDATA[ myText1.text = str; myText2.text = "The String length is " + strlength.toString();} ]]> </fx:Script></s:Application> |
In this example we have created a string type variable and initialize string value. After that we have apply length property to find out the length of the string.
Output:-
