Latest web development tutorials

Java Examples - turn uppercase lowercase string

Java Examples Java Examples

The following example uses the String toUpperCase () method to a string from lowercase to uppercase:

//StringToUpperCaseEmp.java 文件

public class StringToUpperCaseEmp {
   public static void main(String[] args) {
      String str = "string abc touppercase ";
      String strUpper = str.toUpperCase();
      System.out.println("Original String: " + str);
      System.out.println("String changed to upper case: "
      + strUpper);
   }
}

The output is the above code examples:

Original String: string abc touppercase 
String changed to upper case: STRING ABC TOUPPERCASE 

Java Examples Java Examples