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!
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!
how to concatenate in kotlin
//This is another way too! The Kotlin language is very special because it somewhat flexible!
//If you use vscdoe to run it just do fun main(){}
fun main(args: Array<String>) {
val str1 = "hello"
val str2 = "hi"
val str3 = "bye"
// joining using + operator
// can also be written like this:
// val str4 = str1.plus(str2).plus(str3)
val str4 = str1 + str2 + str3
// displaying concatenated string
println(str4)
}
//output is:
hellohibye
//Hopefully it helps I got it from the website! I did test if it works and it is working good!
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us