fun main() { | |
displayInfo("John Doe", 10) | |
} | |
fun displayInfo(name: String, age: Int) { | |
- val info = "Hi there!👋 My name is \"" + name + "\".\nI'm " + age + " years old." | |
+ val info = """ | |
+ |Hi there!👋 My name is "$name". | |
+ |I'm $age years old. | |
+ """.trimMargin() | |
println(info) | |
// prints | |
// "Hi there!👋 My name is John Doe. | |
// I'm 10 years old." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment