 |
[Java] 字串比較 String compare | Andro Tips - Web Development How-to
在Java中若單純要比較兩個字串,盡量不要使用 == The == operator checks to see if two objects are exactly the same object. 建議使用 equals() 以下是範例 String s = "test", t = "test"; if (s == t) // Legal, but usually WRONG. if (s.equals(t)) // RIGHT if (s ...
androchen.blogspot.com |
 |