- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java String toUpperCase() and toLowerCase() methods
The toUpperCase() method converts all of the characters in this String to upper case using the rules of the default locale
The toLowerCase() method converts all of the characters in this String to lower case using the rules of the default locale.
Example
import java.lang.*; public class StringDemo { public static void main(String[] args) { // converts all upper case letters in to lower case letters String str1 = "SELF LEARNING CENTER"; System.out.println("string value = " + str1.toLowerCase()); str1 = "TUTORIALS POINT"; System.out.println("string value = " + str1.toLowerCase()); // converts all lower case letters in to upper case letters String str2 = "This is TutorialsPoint"; System.out.println("string value = " + str2.toUpperCase()); str2 = "www.tutorialspoint.com"; System.out.println("string value = " + str2.toUpperCase()); } }
Output
string value = self learning centre string value = tutorials point string value = THIS IS TUTORIALSPOINT string value = WWW.TUTORIALSPOINT.COM
- Related Articles
- Java String toLowerCase() method example.
- Java String toUpperCase() method example.
- Java toUpperCase() with examples
- Java String Methods
- Java String Comparison Methods.
- Java String replace(), replaceFirst() & replaceAll() Methods
- Java methods to convert Double to String
- C# String Methods
- Python String Methods ?
- Class that contains a String instance variable and methods to set and get its value in Java
- How to use toLowerCase () in Android textview?
- How to use toUpperCase () in Android textview?
- Create a custom toLowerCase() function in JavaScript
- How can we sort a string without using predefined methods in Java?
- What are new methods added to the String class in Java 9?

Advertisements