Home » Java programming language

Java String toLowerCase() Method with Example

Java String toLowerCase() Method: Here, we are going to learn about the toLowerCase() method with example in Java.
Submitted by IncludeHelp, on February 08, 2019

String toLowerCase() Method

toLowerCase() method is a String class method, it is used to convert given string into the lowercase.

Syntax:

    String String_object.toLowerCase();

Here, String_object is a String object which we have to convert into lowercase. The method does not change the string; it returns the lowercase converted string.

Example:

    Input:
    str = "Welcome at IncludeHelp!"
    Function call:
    ans = str.toLowerCase()

    Output:
    ans = "welcome at includehelp!"

Code:

public class Main
{
    public static void main(String[] args) {
		String str = "Welcome at IncludeHelp!";
		String ans = str.toLowerCase();
		System.out.println("str = " + str);
		System.out.println("ans = " + ans);		
    }
}

Output

str = Welcome at IncludeHelp!
ans = welcome at includehelp!





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.