Home >>Java String Methods >Java String toLowerCase() Method

Java String toLowerCase() Method

Java String toLowerCase() Method

Java toLowerCase() method in Java String is used to converts a string to lower case letters.

Syntax

public String toLowerCase()

Parameters

None

Returns

It is used to return A String value which representing the new string converted to lower case

Java String toLowerCase() Method Example 1


public class MyClass 
{
  public static void main(String[] args) 
  {
    String str = "Hello Phptpoint";
    System.out.println(str.toUpperCase());
    System.out.println(str.toLowerCase());
  }
}

Output:
HELLO PHPTPOINT
hello phptpoint

Java String toLowerCase() Method Example 2


import java.util.Locale;  
public class MyClass 
{  
    public static void main(String[] args) 
	{  
        String nm = "PHPTPOINT WoRld HELLO stRIng";    
        String eng = nm.toLowerCase(Locale.ENGLISH);  
        System.out.println(eng);  
     
    }  
}  

Output:
phptpoint world hello string

No Sidebar ads