区分大小写

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));
}
}
发布了31 篇原创文章 · 获赞 0 · 访问量 443

猜你喜欢

转载自blog.csdn.net/he_lei/article/details/104032339