I'm new to Kotlin, and I'm looking for tips that rewrite the following code in a more elegant way.
var s: String? = "abc" if (s != null && s.isNotEmpty()) {
If I use the following code:
if (s?.isNotEmpty()) {
The compiler will complain that
Required: Boolean Found: Boolean?
Thanks.
source share