Write a Java program to convert all the characters in a string to lowercase.

Java Programming Language / String in java

826

Program:

public class Exercise {
       public static void main(String[] args)
    {
        String str = "The Quick BroWn FoX!";

        // Convert the above string to all lowercase.
        String lowerStr = str.toLowerCase();

        // Display the two strings for comparison.
        System.out.println("Original String: " + str);
        System.out.println("String in lowercase: " + lowerStr);
    }
}

Output:

Original String: The Quick BroWn FoX!
String in lowercase: the quick brown fox!
Press any key to continue . . .

Explanation:

None

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.