当前位置:首页 > 笔记

kotlin 判空

jsc6年前 (2019-10-31)笔记3491

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

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

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

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

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

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


扫描二维码推送至手机访问。

版权声明:本文由微小站发布,如需转载请注明出处。

本文链接:https://jsc0.com/post/176.html

标签: kotlin 判空
分享给朋友:

“kotlin 判空” 的相关文章

百度坐标和GPS坐标转换

百度地图API中,有GPS坐标转百度坐标的功能http://dev.baidu.com/wiki/static/map/API/examples/?v=1.2&0_6#0&6http接口是:http://api.map.baidu.com/ag/coord/convert?from=…

Bitmap too large to be uploaded into a texture

从手机相册里面显示图片,但是发现有的图片能显示有的图片不能显示,路径都是对的,程序也没提示任何错误。后来通过看日志发现error message: Bitmap too large to be uploaded into a texture (4208x3120, max=4096x409…

百度地图被外部调用的问题

选择手机里安装的外部地图应用,在外部地图应用里显示商户的位置。˂br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: "Microsoft Yahei&q…

viewpager、listview、gridview、scrollview去除蓝色阴影

xml:   android:overScrollMode="never"java:    view.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);…

Notification 8.0 关闭声音震动

NotificationChannel notificationChannel = new NotificationChannel                    (NOTIFICATION_C…

RecyclerView点击最后一个无效

RecyclerView设置的OnItemClick点击最后一个无效,在点击最后一个无效后在部分手机上点击其他item会触发最后一个view的onclick事件,有的手机始终无反应。是因为popwindow里RecyclerView宽度设置为match_parent的原因改为wrap_content…