close

在Java裡面並不能使用==來判斷

需要使用equals來判斷

例如:

String test="hello";

if(test.equals("hello")==true){

  Toast.makeText(this,"字串相等",Toast.LENGTH_SHORT).show();

}

 

http://ocean2002n.pixnet.net/blog/post/86030686-%5Bandroid%5D-%E5%88%A4%E6%96%B7edittext%E8%BC%B8%E5%85%A5%E6%98%AF%E5%90%A6%E7%82%BA%E7%A9%BA%E7%99%BD

arrow
arrow
    文章標籤
    string 判斷 equals
    全站熱搜
    創作者介紹
    創作者 imdmao 的頭像
    imdmao

    阿毛在這

    imdmao 發表在 痞客邦 留言(0) 人氣()