Home > Java > javaTutorial > Java example - convert string from lower case to upper case

Java example - convert string from lower case to upper case

黄舟
Release: 2017-02-22 09:42:09
Original
2089 people have browsed it

The following example uses the String toUpperCase() method to convert the 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);
   }}
Copy after login
The output result of the above code example is:
Original String: string abc touppercase 
String changed to upper case: STRING ABC TOUPPERCASE
Copy after login

The above is the Java example - string lowercase Convert the content to uppercase. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template