首页 > 笔记 > 正文

kotlin 判空

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

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

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

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

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

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

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


猜你喜欢

日历
«    2024年3月    »
123
45678910
11121314151617
18192021222324
25262728293031
标签列表
最近发表
友情链接