Skip to content

Instantly share code, notes, and snippets.

@gyugyu90
Last active April 26, 2020 11:05
Show Gist options
  • Save gyugyu90/f62c7a4b81a9a2aebea5273948db411a to your computer and use it in GitHub Desktop.
Save gyugyu90/f62c7a4b81a9a2aebea5273948db411a to your computer and use it in GitHub Desktop.
fun main() {
var a = 1
// 템플릿 내에 변수를 넣거나
val s1 = "a is $a"
a = 2
// 변수를 활용한 표현식을 넣을 수도 있습니다.
val s2 = "${s1.replace("is", "was")}, but now is $a"
println(s2) // a was 1, but now is 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment