Convert All Characters In A String To Uppercase | Java Programs

Output:

*** UpperCase All Characters In String ***

Original String:     This is a Test!
String in uppercase: THIS IS A TEST!

Click Here For Java Online Compiler

Solution:

public class UppercaseString {

    public static void main(String[] args) {
        System.out.println("*** UpperCase All Characters In String ***" + "\n");
        String str = "This is a Test!";

        // Convert the above string to all uppercase.
        String upperStr = str.toUpperCase();

        System.out.println("Original String:     " + str);
        System.out.println("String in uppercase: " + upperStr);
    }
}
Share This :

Related Post



sentiment_satisfied Emoticon