A very basic question, what is the right way to concatenate a String in Kotlin?
In Java you would use the concat() method, e.g.
concat()
String a
Yes, you can concatenate using a + sign. Kotlin has string templates, so it's better to use them like:
+
var fn = "Hello" var ln = "World"
"$fn $ln" for concatenation.
"$fn $ln"
You can even use String.plus() method.
String.plus()
yourString += "newString"
This way you can concatenate a string