Home  >  Q&A  >  body text

android - equals比较遇到的问题。

有人遇到过这样的情况吗?
用equals 也是一样。

LocalInfo.get(0).getphone是从sqlite 联系人表中查询出来的字串。
service 是从后台服务器那里返回接收到的字串。
不知道这个要怎么比较。

PHP中文网PHP中文网2741 days ago379

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 17:41:28

    What is the method of contentEquals? Is there any impact if trim() is not added?

    reply
    0
  • PHPz

    PHPz2017-04-17 17:41:28

    contentEquals(StringBuffer sb) is a method that compares strings to the specified StringBuffer. Is your method correct? To compare strings directly, please use equals

    reply
    0
  • Cancelreply