是否有任何方法为Kotlin中的多个可空变量链接多个let?
fun example(first: String?, second: String?) {
first?.let {
second?.let {
// Do something just if both are != null
}
}
}
就像这样:
fun example(first: String?, second: String?) {
first?.let && second?.let {
// Do something just if both are != null
}
}
相似问题