最近项目中,有有一个需求,当点赞数为零时,点赞数显示为"赞",否则显示为数字。

无法完成需求,于是转换方法:

,成功!


因此,对于字符串的判断,不能像数字判断一样,要用.equals("要进行判断的字符串").
最近项目中,有有一个需求,当点赞数为零时,点赞数显示为"赞",否则显示为数字。
,成功!
因此,对于字符串的判断,不能像数字判断一样,要用.equals("要进行判断的字符串").
本文标题:对于字符串的判断
本文链接:https://www.haomeiwen.com/subject/ahzpvftx.html
网友评论