Answers for "kotlin write var in string"

1

kotlin variable in string

//Kotlin variable in string

//variables go in a ${} in a string, example
println("Happy ${age}th birdthday, ${name}!"
Posted by: Guest on October-08-2020
1

variables inside strings kotlin

// Use the $ sign to get the variable value inside a string:

//Example 1:
println("$days days and $hours hours to go!")
  
//You can also use {} to contain expressions:
println("${days*24} hours to go!")
println("${myList}")
Posted by: Guest on June-30-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language