String class toLowerCase method example:- This example demonstrates the working of toLowerCase method example. this method returns completly formated data from uppercase to lower case.
Syntax:-toLowerCase()
Here is the code:-
/**Output of the program:-
* @(#) ToLowerCaseString.java
* ToLowerCaseString class demonstrates the working of toLowerCase() method of String class of lang package
* @version 16-May-2008
* @author Rose India Team
*/
public class ToLowerCaseString {
public static void main(String args[]) {
//method converts all letters of String in to lower case letters
//method cannot be invoked while working with CharSequence interfaces
String heram = "MARYADA PURUSHOTTAM RAM";
System.out.println(" formatted value of string 'heram' is: "
+ heram.toLowerCase());
String krishna = new String("JAI_MAHA_KAAL"), meghnaath = "";
meghnaath = krishna.toLowerCase();
System.out.println(" formatted value of string 'krishna' is: "
+ meghnaath);
}
}
formatted value of string 'heram' is: maryada purushottam ram formatted value of string 'krishna' is: jai_maha_kaal |
No comments:
Post a Comment