Home » Java programming language

Java Character class toLowerCase() method with example

Character class toLowerCase() method: Here, we are going to learn about the toLowerCase() method of Character class with its syntax and example.
Submitted by Preeti Jain, on October 26, 2019

Character class toLowerCase() method

  • toLowerCase() method is available in java.lang package.
  • toLowerCase() method is used to return the lowercase character of the given char value.
  • toLowerCase() method does not throw an exception at the time of representing uppercase character to lowercase character or lowercase to the lowercase character.

Syntax:

    public char toLowerCase (Char value);

Parameter(s):

  • Char value – represents the char value to be converted.

Return value:

The return type of this method is char, it returns the lowercase conversion of the given char value.

Example:

// Java program to demonstrate the example 
// of char toLowerCase (Char value) method of Character class	

public class ToLowerCaseOfCharacterClass {
    public static void main(String[] args) {
        // It returns p because the passing character will 
        // be converted in LowerCase by using toLowerCase()
        char result1 = Character.toLowerCase('P');

        // It returns p because the passing character is
        // already in LowerCase
        char result2 = Character.toLowerCase('p');

        // Display values of result1 , result2
        System.out.println("Character.toLowerCase('P'): " + result1);
        System.out.println("Character.toLowerCase('p'): " + result2);
    }
}

Output

Character.toLowerCase('P'): p
Character.toLowerCase('p'): p





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.