大文字と小文字を区別する

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