Hi guys! Is there a way to use expressions with st...
# announcements
m
Hi guys! Is there a way to use expressions with string interpolation? This looks horrible:
Copy code
it.Specification?.let {
                                with(it) {
                                    val mk = (make ?: "")
                                    val md = model ?: ""
                                    "$mk $md"
                                }
                            }
k
(use ``` for multi-line code)
m
Thanks!
g
"${make ?: ""} ${model ?: ""}"
And use
run
instead of
let
+
with
Also, do you really want to get string that contains only space in case of null for specification?