1.使用String类的toUpperCase()方法和toLowerCase()方法来实现大小写的转换
String str =new String("abc DEF");
String newstr=str.toUpperCase();
String newstr1=str.toLowerCase();
System.out.println("大写字母"+newstr);
System.out.println("小写字母"+newstr1);
System.out.println("-----------------------");
2.分别截取字符串str1和字符串str2中的部分内容。如果截取后的两个子串相同(不区分大小写)输出相同,否则输出不同
public static void main(String[] args) {
/*
* 分别截取字符串str1和字符串str2中的部分内容。如果截取后的两个子串相同(不区分大小写)输出相同,否则输出不同
* substring(beginIndex,endIndex)
* 下标从0开始,空格占用一个索引位置
* 比较equals 区分大小写的。
*/
String st1=new String("hello1word");
String st2=new String("Hello2beijing");
String substr1=st1.substring(0,5);
String substr2=st2.substring(0,5);
System.out.println(substr1);
System.out.println(substr2);
boolean b &#