Case sensitive

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));
}
}
Published 31 original articles · won praise 0 · Views 443

Guess you like

Origin blog.csdn.net/he_lei/article/details/104032339