Answers for "concatenation in kotlinb"

0

how to concatenate in kotlin

fun main() {

    val a = 11
    val b = 10

        println("$a is larger than $b.")
        println("max variable holds value of a.")
        
}

//It will output!
11 is larger than 10.
max variable holds value of a.


//You conactenate using the $ symbol and put the var in it!
//Example is $a or $b

//Hopefully it helps!
Posted by: Guest on July-26-2021
0

how to concatenate in kotlin

fun main() {
    var list = listOf("Hello", "World")
 
    var result = list.joinToString("")
    print(result)
}

//It will print:
	HelloWorld

//This is another way to concatenate in Kotlin!
//Hopefully it helps!
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language