Thursday 2 March 2017

Java String toLowerCase() Method




The toLowerCase() Method

This method converts all upper case characters of the invoking String to lower case.
The general form is:

String toLowerCase();

Consider the following Example:

ToLowerCaseTest.java

 class ToLowerCaseTest
 {
  public static void main(String arg[])
  {
    String str=" HELLO JAVA";

    System.out.println("Before toLowerCase():"+str);
    System.out.println("After toLowerCase():"+str.toLowerCase());
  }
 }

The output generated by the following program is:
 Before toLowerCase(): HELLO JAVA
 After toLowerCase(): hello java



 Next Topic Shahbaz

0 comments:

Post a Comment

Powered by Blogger.

Stats