Skip to content
geeksforgeeks
  • 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
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • 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 charAt() 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 charAt() Method

N

Niraj_Pandey
Improve
Article Tags :
  • DSA
  • Java
  • Java-Functions
  • Java-Strings
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: [GFGTABS] Java class Geeks { public static void main(String args[]) { // Custom input string String str = "Geeksforgeeks"; // Converting above input string to
    2 min read
  • Java String trim() Method
    The trim() method of the String class in Java is used to remove leading and trailing whitespace from a string. The Unicode value of the space character is "\u0020". It does not remove any whitespace in the middle of the string. This method returns a new string with the whitespace removed and leaves
    4 min read
  • Java String valueOf() Method
    The valueOf() method of the String class in Java helps to convert various data types like integers, floats, booleans, and objects into their string representations. It makes it simple to work with string manipulation, logging, and displaying data efficiently. Example: To convert a number into text f
    3 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
  • Java String charAt() Method
    String charAt() method in Java returns the character at the specified index in a string. The Index of the first character in a string is 0, the second character is 1, and so on. The index value should lie between 0 and length() - 1. If the index value is greater than or equal to the string length or
    3 min read
  • Java String indexOf() Method
    In Java, the String indexOf() method returns the position of the first occurrence of the specified character or string in a specified string. In this article, we will learn various ways to use indexOf() in Java. Example: Below is the simplest way that returns the index of the first occurrence of a s
    3 min read
  • Java String toCharArray() Method With Example
    In Java, the toCharArray() method of the String class converts the given string into a character array. The returned array length is equal to the length of the string. This is helpful when we need to work with individual characters of a string for tasks like iteration or modification. Example: Below
    2 min read
  • Java String getBytes() Method
    In Java, the getBytes() method of the String class converts a string into an array of bytes. This method is useful for encoding the strings into binary format, which can then be used for file I/O, network transmission, or encryption. It can be used with the default character set or with a specified
    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
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