equalsIgnoreCase()函数 忽略大小写的比较函数

                            equalsIgnoreCase()  

public boolean equalsIgnoreCase(String anotherString)

Compares this String to another String, ignoring (忽略) case (大小写) considerations. Two strings are considered equal ignoring case if they are of the same length, and corresponding( 相当、一致) characters in the two strings are equal ignoring case.

Two characters c1 and c2 are considered the same, ignoring case if at least one of the following is true:

  • The two characters are the same (as compared by the == operator). //两字符相等(相当于= =)
  • Applying the method Character.toUpperCase(char) to each character produces the same result. 
       //c1经过Character.toUpperCase(char)处理后
  • Applying the method Character.toLowerCase(char) to each character produces the same result.
        //c1经过Character.toLowerCase(char)处理后

 

Parameters:
anotherString - the String to compare this String against.
Returns:
true if the argument is not null and the Strings are equal, ignoring case; false otherwise.
See Also:
equals(Object), Character.toLowerCase(char) , Character.toUpperCase(char)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值