java将所有的字符串转换为大写或小写

public class DaXie {
public static void main(String[] args) {
/**将所有的字符串转换成大写或小写字母并打印出来*/
String str = new String("Hello Java World");
System.out.println("原字符串:" + str + " ");
/*使用toUpperCase()方法实现大写转换*/
String newA = str.toUpperCase();
System.out.println("大写转换:" + newA);
/*使用toLowerCase()方法实现小写转换*/
String newB = str.toLowerCase();
System.out.println("小写转换:" + newB);
  }
}
原文地址:https://www.cnblogs.com/THEONLYLOVE/p/9115608.html