Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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}")
 
PREVIOUS NEXT
Tagged: #variables #strings #kotlin
ADD COMMENT
Topic
Name
7+3 =