String class provides methods toUpperCase() and toLowerCase().
String class provides methods toUpperCase() and toLowerCase().String toUpperCase() and toLowerCase() methods example:-
String class provides methods toUpperCase() and toLowerCase(). Method toUpperCase() convert alphabetical characters in the string to uppercase and method toLowerCase() convert alphabetical characters in the string to lowercase. We have used these two methods in this example. user can see how to use these methods.
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 = str1.toUpperCase(); // for lower casetextcontrol2.text = str1.toLowerCase(); } ]]> </fx:Script></s:Application> |
In this example, we have created a string type variable and initialize a string as "Rose India" and apply both toLowerCase() and toUpperCase() methods on them.
Output:-
