Is there something like Pythons 3.8 f-string = syn...
# getting-started
m
Is there something like Pythons 3.8 f-string = syntax in Kotlin? I.e. with
val foo="bar"
I would like to not have to write the
foo=
part in
"foo=$foo"
in order to get the string
foo=bar
, but, like in Python, perhaps like this instead:
"${foo=}"
but that gives me compilation errors in Kotlin version 1.3.41 (JRE 1.8.0_221-b11)
k
There's no feature like this.
You could make your own println or printf version or something like that that takes
::foo
as a parameter and gets the name and value that way.
💡 4