toUpperCase() String Example

toUpperCase() String Example

java.lang.String class comes with toUpperCase() String method to convert all lowercase letters into uppercase in the string. After modification, a new string is returned with all the conversions.

The signature toUpperCase() String is given as defined in Java API.

  • public String toUpperCase(): Returns a new string after converting all the lowercase letters to uppercase letters in the given string.

In the following example, toUpperCase() String is used to convert all lowercase letters to uppercase letters in string oldString. Observe the screenshot, the original string oldString is not disturbed.

toUpperCase() String
Output screenshot of toUpperCase() String Example

Pass your comments and suggestions on this tutorial "toUpperCase() String Example".

Leave a Reply

Your email address will not be published. Required fields are marked *