Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA Tutorial
  • Data Structures
  • Algorithms
  • Array
  • Strings
  • Linked List
  • Stack
  • Queue
  • Tree
  • Graph
  • Searching
  • Sorting
  • Recursion
  • Dynamic Programming
  • Binary Tree
  • Binary Search Tree
  • Heap
  • Hashing
  • Divide & Conquer
  • Mathematical
  • Geometric
  • Bitwise
  • Greedy
  • Backtracking
  • Branch and Bound
  • Matrix
  • Pattern Searching
  • Randomized
Open In App
Next Article:
Java String toLowerCase() Method
Next article icon

Java String toLowerCase() Method

Last Updated : 23 Dec, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Java String toLowerCase() method is used to convert all letters to lowercase in a given string.

Example:

Java
import java.util.*;   class Geeks  {  	public static void main(String args[])      {  		// Custom input string  		String s = "Geeks for Geeks";   		// Converting string s to lowercase letter  		String s2 = s.toLowerCase();   		System.out.println(s2);  	}  } 

Output
geeks for geeks 

Syntax of toLowerCase()

public String toLowerCase ()

Return Value : Returns a string in lowercase letter.

Internal Working of toLowerCase()

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.

The package view of the method is as follows: 

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

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.

Java toLowerCase(Locale loc)

Converts all the characters into lowercase using the rules of the given Locale.

Syntax of toLowerCase()

public String toLowerCase (Locale loc)

  • Parameters: Locale value to be applied.
  • Return Value: Returns a string in lowercase letter.

Example:

Java
// Working of toLowerCase() Method  // present inside Locale class import java.util.Locale;  class Geeks {        public static void main(String args[]) {               String s = "I Know YOI Bui You Don't Know ME";          // Locales with the language "tr" for TURKISH         //"en" for ENGLISH is created         Locale TURKISH = Locale.forLanguageTag("tr");         Locale ENGLISH = Locale.forLanguageTag("en");          // Converting string s to lowercase letter         // using TURKISH and ENGLISH language         String str1 = s.toLowerCase(TURKISH);         String str2 = s.toLowerCase(ENGLISH);          System.out.println(str1);         System.out.println(str2);     } } 

Output
ı know yoı bui you don't know me i know yoi bui you don't know me

Next Article
Java String toLowerCase() Method

N

Niraj_Pandey
Improve
Article Tags :
  • Java
  • DSA
  • Java-Strings
  • Java-Functions
Practice Tags :
  • Java
  • Java-Strings

Similar Reads

    Java String toUpperCase() Method
    Java String toUpperCase() method of String class is used to convert all characters of the string into an uppercase letter. Example:Javaclass Geeks { public static void main(String args[]) { // Custom input string String str = "Geeksforgeeks"; // Converting above input string to // uppercase letters
    2 min read
    StringJoiner toString() method in Java
    The toString() of StringJoiner is used to convert StringJoiner to String. It returns the current value, consisting of the prefix, the values added so far separated by the delimiter, and the suffix, unless no elements have been added in which case, the prefix + suffix or the emptyValue characters are
    2 min read
    JSTL fn:toLowerCase() Function
    In JSTL, the fn:toLowerCase function converts all the characters of the input or specified string into the lowercase format. This allows the developers to transform the string case with the JavaServer Pages and also ensures the proper representation of text in lowercase. In this article, we will see
    2 min read
    Short shortValue() Method in Java
    The shortValue() is an inbuilt method of the Short class in Java and is used to return the Short value of this value. Syntax: public short shortValue() Parameters: The method does not take any parameter. Return Value: The method returns the numeric value represented by this object after conversion t
    2 min read
    Java String contains() Method with Example
    The String.contains() method is used to search for a sequence of characters within a string. In this article, we will learn how to effectively use the string contains functionality in Java.Example:In this example, we check if a specific substring is present in the given string.Java// Java Program to
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences