Java String toUpperCase() Method Last Updated : 23 Dec, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Java String toUpperCase() method of String class is used to convert all characters of the string into an uppercase letter. Example: Java class Geeks { public static void main(String args[]) { // Custom input string String str = "Geeksforgeeks"; // Converting above input string to // uppercase letters using UpperCase() method String res = str.toUpperCase(); // Print the uppercased string System.out.println(res); } } OutputGEEKSFORGEEKS Note: Lowercase is done using the rules of the given Locale.There is 2 variant of toUpperCase() method. The key thing that is to be taken into consideration is toUpperCase() method worked the same as to UpperCase(Locale.getDefault()) method as internally default locale is used. Java String toUpperCase(Locale locale)The toUpperCase(Locale locale) method returns a new String object which is the original string in upper case with respect to the Locale method parameter. Syntax String toUpperCase() Method in Javapublic String toUpperCase(Locale loc)Parameters:Type 1 : Locale value to be applied as it converts all the characters intoType 2 : NAExample: Java import java.util.Locale; class Geeks { public static void main(String args[]) { // Custom input string String str = "Geeks for Geeks"; // Locales with the language "tr" for TURKISH //"en" for ENGLISH is created Locale TURKISH = Locale.forLanguageTag("tr"); Locale ENGLISH = Locale.forLanguageTag("en"); // Converting string str to uppercase letter // using TURKISH and ENGLISH language String strup1 = str.toUpperCase(TURKISH); String strup2 = str.toUpperCase(ENGLISH); System.out.println(strup1); System.out.println(strup2); } } OutputGEEKS FOR GEEKS GEEKS FOR GEEKS Comment More infoAdvertise with us Next Article Java String toUpperCase() Method N Niraj_Pandey Follow Improve Article Tags : Java Java-Strings Java-Functions Practice Tags : JavaJava-Strings Similar Reads Java String toLowerCase() Method Java String toLowerCase() method is used to convert all letters to lowercase in a given string.Example:Javaimport 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.toLowerC 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 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 i 2 min read JSTL fn:toUpperCase() Function In JSTL, the fn:toUpperCase() function is used to transform all the characters in a specified string to uppercase. If the input string is in lowercase, then this function can convert all the characters into uppercase. In this article, we will see the Syntax along with Parameters and detailed impleme 1 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 Like