值不为 null 的情况

kotlin ?.let ?:let 连用-冯金伟博客园

值为 null 的情况

kotlin ?.let ?:let 连用-冯金伟博客园

 总结  与 if  else 的效果一样

注意   val num:String? = “”   这样是不为空的