My question in general was if we can concatenate characters? One possible way as @Michal has shown and as you have suggested is to use indexes and convert the result into a String! Another way, similarly, could be s"${str.init.last}${str.last}". I was wondering if characters can be concatenated without conversion to a String?
It depends on what is your goal. Char is in general a number representing character in ASCII table. Adding two Char values is in fact adding numbers. If you wish to produce String, you cannot use addition. Another way is to call .toString method on each char before addition but it makes code less readable.
s"${str.init.last}${str.last}". I was wondering if characters can be concatenated without conversion to a String?.toStringmethod on each char before addition but it makes code less readable.