Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

Java toLowerCase Method

by suresh

The Java toLowerCase Method is one of the String Methods, which is useful to convert the given string into Lowercase letters. In this article, we will show how to use String toLowerCase in Java Programming with example.

Before we get into the example, the basic syntax of the string.toLowerCase in Java is as shown below. Java Programming provides two different methods to convert the specified string into Lowercase letters.

The following Java toLowerCase function will not accept any parameters and convert all the characters in a specified string to lowercase using the rule of the default locale.

public String toLowerCase(); // It will return String 

//In order to use in program
String_Object.toLowerCase()

The following function will accept Locale value as the parameter and convert the characters in a string to lowercase using the user-specified locale.

public String toLowerCase(Locale locale); // It will return String 

//In order to use in program
String_Object.toLowerCase(Locale locale)
  • String_Object: Please specify the valid String Object.
  • locale: Please specify the Locale you want to use while converting the String_Object characters to Lowercase. For example, English, Turkish, Latin, etc.

Java toLowerCase Method Example

The Java string LowerCase method converts all the characters in a string to lowercase. This program will help to understand the string.toLowerCase method.

package StringFunctions;

public class ToLowerCaseMethod {
	public static void main(String[] args) {
		String str = "Free Java Tutorial at Tutorial GateWay";
		
		String str1 = str.toLowerCase();
		String str2 = "TUTORIAL GATEWAY".toLowerCase();
		String str3 = "JAVA TUTOIRIAL".toLowerCase();
		String str4 = "TrY tO ReAd ThIs SenTEnCe".toLowerCase();
		
		System.out.println( "New Lowercase String = " + str1);
		System.out.println( "New Lowercase String = " + str2);
		System.out.println( "New Lowercase String = " + str3);
		System.out.println( "New Lowercase String = " + str4);
	}
}
Java toLowerCase Method 1

The following statements will convert the previously declared String data to lowercase characters and assign them to Str1. Next, we used the toLowerCase String Method directly on string data.

String str1 = str.toLowerCase();
String str2 = "TUTORIAL GATEWAY".toLowerCase();
String str3 = "JAVA TUTOIRIAL".toLowerCase();
String str4 = "TrY tO ReAd ThIs SenTEnCe".toLowerCase();

The following Java System.out.println statements will print the output.

System.out.println( "New Lowercase String = " + str1);
System.out.println( "New Lowercase String = " + str2);
System.out.println( "New Lowercase String = " + str3);
System.out.println( "New Lowercase String = " + str4);

Placed Under: Java

  • SQL DML, DDL, DCL & TCL Cmds
  • SQL NOT EXISTS Operator
  • SQL UPDATE from SELECT
  • SQL AFTER UPDATE Triggers
  • SQL Get Column Names in Table
  • SQL IF ELSE
  • SQL ACID Properties
  • SQL FOR XML PATH
  • Java Two Dimensional Array
  • Java Perfect Number Program
  • Java Count Digits in a Number
  • C Compare Two Strings Program
  • C Print Prime Numbers 1 to 100
  • C program to Reverse a String
  • C Palindrome Number Program
  • C Program for Palindrome String
  • C Remove Duplicate String Chars
  • C Square of a Number Program
  • C Sum and Average of N Number
  • Python Fibonacci Series program
  • Python Area Of Circle Program
  • Python Prime Numbers 1 to 100
  • Python Program for Leap Year
  • Tableau Rank Calculation
  • Tableau Google Maps usage
  • Power BI Format Dates
  • Power BI Top 10 Filters
  • Power BI – Create Hierarchy
  • Power BI DAX Math Functions
  • Learn SSIS in 28 Days
  • SSIS Transformations
  • SSIS Incremental Load
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • R Programming Tutorial

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy