首页 > 笔记 > 正文

kotlin 判空

2019-10-31 笔记 2606 ℃ 0 评论

isNullOrEmpty : 为空指针或者字串长度为0时返回true,非空串与可空串均可调用。

isNullOrBlank : 为空指针或者字串长度为0或者全为空格时返回true,非空串与可空串均可调用。

isEmpty : 字串长度为0时返回true,只有非空串可调用。

isBlank : 字串长度为0或者全为空格时返回true,只有非空串可调用。

isNotEmpty : 字串长度大于0时返回true,只有非空串可调用。

isNotBlank : 字串长度大于0且不是全空格串时返回true,只有非空串可调用。


猜你喜欢

日历
«    2025年2月    »
12
3456789
10111213141516
17181920212223
2425262728
标签列表
最近发表
友情链接