Touppercase Java

Hey guys!! Welcome to flower brackets blog. How are you doing. Today we are going to learn touppercase java.

Touppercase Java

Touppercase java

Not something you do everyday. But occasionally when you are manipulating input from a user you will need to do that.

Also Read – Learn Strings In Java

These methods that I will talk about here will show you how to set that up.

Well, converting java string to uppercase is very straightforward. In java we have two inbuilt methods and they are,

  • toLowerCase()
  • toUpperCase()

Let’s see the code implementation on java toUpperCase and toLowerCase,

public class StringChangeCase
{
   public static void main(String[] args)
   {
      String strConvert = "Flower Brackets";
 
      String convertLower = strConvert.toLowerCase();
      String convertUpper = strConvert.toUpperCase();
 
      System.out.println("Before conversion - " + strConvert);
      System.out.println("\nAfter conversion - \n");
      System.out.println("To Lowercase - " + convertLower);
      System.out.println("To Uppercase - " + convertUpper);
   }
}

Output:

Before conversion – Flower Brackets

After conversion –

To Lowercase – flower brackets
To Uppercase – FLOWER BRACKETS

Related Posts