I am trying to combine Intwith Stringin such a way that the conclusion is String, but not sure how to do it.
Int
String
Here is my code:
val myMessage = context.getString(R.string.mymessage)
where myMessageis the string.
myMessage
Now I want to add Int, which is it.myinfo.codeid.
it.myinfo.codeid
You can use string patterns :
"${context.getString(R.string.mymessage)} ${it.myinfo.codeid}"
Use +as you know in Java:
+
context.getString(R.string.mymessage) + " " + it.myinfo.codeid
or use a more idiomatic approach to templates: