其他分享
首页 > 其他分享> > 安卓判断字符串是否相等

安卓判断字符串是否相等

作者:互联网

Android 判断字符串是否相等

  判断两个String是否相等不能直接用== 或!=,需要用equals()判断,若相等,则返回1 忽略大小写用
equalsIgnoreCase
判断TextView中文字是否相等: TextView A,B; if (A.getText().toString.equals(B.getText().toString())) {     //A=B; }else{     //A!=B; } 判断TextView是否为空 if( "".equals(A.getText().toString())){     //空 }else{     //非空 }

标签:相等,安卓,equals,getText,判断,toString,字符串,TextView
来源: https://www.cnblogs.com/jyc226/p/15701725.html