Search Java Programs

Wednesday, January 20, 2010

Java String toLowerCase Example

String class toLowerCase method example


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:-

 /**
* @(#) 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);

}
}
Output of the program:-
formatted value of string 'heram' is: maryada purushottam ram
formatted value of string 'krishna' is: jai_maha_kaal

No comments:

Post a Comment

Website Design by Mayuri Multimedia