public class Test {
public static void main(String[] args) {
String str = "abcdefg";
String other = "CdE";
//两种方式全部变成大写,或者全部变成小写
//toUpperCase转换为大写
//str = str.toUpperCase();
//other = other.toUpperCase();
//或者全部转换小写
//str = str.toLowerCase();
//other = other.toLowerCase();
toLowerCase()
//是否包含
System.out.println(str.contains(other));
}
}
区分大小写
最新推荐文章于 2024-03-01 21:39:58 发布