In the Action Script3, substring are sequential characters that are found from a string. String class provide methods for finding substring from string.
In the Action Script3, substring are sequential characters that are found from a string. String class provide methods for finding substring from string.String substring() method example:-
In the Action Script3, substring are sequential characters that are found from a string. String class provide methods for finding substring from string. Method substring(int, int ) takes two integer type parameters, first is starting index position of the sub string and second is end index position of the sub string. In this example we have used this method.
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[ textcontrol1.text = str; textcontrol2.text = substring; } ]]> </fx:Script> <s:Panel width="250" height="200" title="String substring() method example" backgroundColor="0xEEFFEE"></s:Application> |
Output:-
