Methods of String toLowerCase()

There are two types of toLowerCase() methods as follows: 

  1. toLowerCase()
  2. toLowerCase(Locale loc): Converts all the characters into lowercase using the rules of the given Locale.

Locale in Java(Internal Working of toLoweCase())

The Locale class is part of java.util package. It is used for extracting and manipulating the information. Locale object represents a geographical, political, or cultural region.

Example Statement:

// Creates a Locale for the English language
Locale locale1 = new Locale("en");

It plays a vital role in toLowerCase() conversion where it checks the elements and helps to convert them into Lower Case. To know more about the topic refer to Locale article.

Note: Internally toLowerCase() works in similar way as toLowerCase(Locale.getDefault()) method.

Syntax of toLowerCase()

public String toLowerCase ()
public String toLowerCase (Locale loc)

The package view of the method is as follows: 

--> java.util Package
--> String Class
--> toLowerCase() Method  

Parameters

  • Locale value to be applied.

Return Value 

  • Returns a string in lowercase letter.

Java String toLowerCase() with Examples

Java String toLowerCase() method is used and operated over a string where we want to convert all letters to lowercase in a string. In this article, we will learn to convert Uppercase into Lowercase using toLowerCase() in Java.

Similar Reads

Methods of String toLowerCase()

There are two types of toLowerCase() methods as follows:...

Example Java toLowerCase()

Example 1:...