Kotlin 2 · Basics and null safety
Insert values in strings
Use $name or ${expression} inside a string.
println("$name scored ${score * 2} points")
Official Kotlin 2 documentation
Kotlin 2 · Basics and null safety
Use $name or ${expression} inside a string.
println("$name scored ${score * 2} points")
Official Kotlin 2 documentation
Was this page helpful?