[lang-ref] 文字列中の変数補完 ( kotlin )
@Test
fun stringInterpolationWithVariable() {
// "$x"
val name = "John"
val s = "My name is $name."
assertEquals("My name is John.", s)
}
@Test
fun stringInterpolationWithVariableAlternative() {
// "${x}"
val name = "John"
val s = "My name is ${name}."
assertEquals("My name is John.", s)
}