Java字符串大小写更改示例代码


Java字符串大小写更改示例代码

public class Sample {

   public static void main(String args[]){

      String str = "Hello how are you";

      String strUpper = str.toUpperCase();

      System.out.println("Lower to upper : "+strUpper);

      String strLower = str.toLowerCase();

      System.out.println("Upper to lower : "+strLower);

   }

}