the filter expression is a bit trickier. a couple ...
# language-proposals
k
the filter expression is a bit trickier. a couple of additions to the stdlib like the following were previously proposed:
Copy code
inline fun <T> T.assuming(condition: (T) -> Boolean) = if (condition(this)) this else null
then you can write
Copy code
nullableString?.length?.assuming { it <= 10 }