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

More basics and null safety commands

All basics and null safety commands · Kotlin 2 cheatsheet

Was this page helpful?