Java String toUpperCase()24 Mar 2025 | 3 min read The java string toUpperCase() method returns the string in uppercase letter. In other words, it converts all characters of the string into upper case letter. The toUpperCase() method works same as toUpperCase(Locale.getDefault()) method. It internally uses the default locale. Internal implementationSignatureThere are two variant of toUpperCase() method. The signature or syntax of string toUpperCase() method is given below: The second method variant of toUpperCase(), converts all the characters into uppercase using the rules of given Locale. Returnsstring in uppercase letter. Java String toUpperCase() method exampleExampleCompile and RunOutput: HELLO STRING Java String toUpperCase(Locale locale) Method Example 2Output: HELLO STR?NG HELLO STRING Next TopicJava String trim() |
» « Java Java, being a versatile and widely-used programming language, provides a rich set of functionalities for handling strings. One powerful feature that developers often leverage is the substring method. The method allows us to extract a portion of a string, providing flexibility in manipulating and...
5 min read
» « Java String.split() Method The split() method is defined in the String class. It splits this string around matches of the given regular expression. This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings...
6 min read
Java The compareTo() method in Java's String class compares two strings lexicographically. It compares strings on the basis of the Unicode value of each character in the strings. If the first string is lexicographically greater than the second string, it returns a positive number (difference of character...
5 min read
Java String The Java String class method compares the two given strings on the basis of the content of the string irrespective of the case (lower and upper) of the string. It is just like the equals() method but doesn't check the case sensitivity....
3 min read
Java The Java String class getBytes() method does the encoding of string into the sequence of bytes and keeps it in an array of bytes. Signature There are three variants of getBytes() method. The signature or syntax of string getBytes() method is given below: public byte[] getBytes() public byte[]...
3 min read
Java String.contains() Method In Java, the String.contains() method searches the sequence of characters in the given string. It returns true if the sequence of char values is found in this string otherwise returns false. Java String.contains() Method The String.contains() method is used to determine whether one string contains...
6 min read
Java Method The Java String class intern() method returns the interned string. It returns the canonical representation of string. It can be used to return string from memory if it is created by a new keyword. It creates an exact copy of the heap string object...
4 min read
Java String.concat() Method Signature The signature of the string concat() method is given below: public String concat(String anotherString) Parameter anotherString : another string i.e., to be combined at the end of this string. Returns combined string String Concatenation The Java String class concat() method combines specified string at the end of string....
3 min read
Java String.endsWith() Method The Java String class endsWith() method checks if this string ends with a given suffix. It returns true if this string ends with the given suffix; else returns false. Signature public boolean endsWith(String suffix) Parameter suffix: A Sequence of characters Returns: true or false Internal Implementation public boolean endsWith(String suffix)...
3 min read
Java String.length() Method The Java String class's length() function yields the total number of characters (or Unicode code units) in the string. The length of a string may be easily and quickly determined with this method that is helpful for a variety of string manipulation tasks....
6 min read
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India