String.equals()對大小寫敏感霎苗!
String.equalsIgnoreCase( )則忽略大小寫!
public static void main(String[] args) {
System.out.println("aa".equals("AA"));
System.out.println("aa".equalsIgnoreCase("AA"));
}
結(jié)果
true
false
public static void main(String[] args) {
System.out.println("aa".equals("AA"));
System.out.println("aa".equalsIgnoreCase("AA"));
}
true
false