If I understand correctly when you use let it should run the code in the block if the condition is true but I am finding inconsistency with that so I wrote the following simple code to test it out…
val str = ""
str.isNotEmpty().let {
println("is not empty")
}
str.isEmpty().let {
println("is empty")
}
The results were…
is not empty
is empty
So what I am wondering is how it can be both empty and not empty at the same time?