How can I convert CharArray / Array<Char> to a String?
you can simply using Array#joinToString
:
val result: String = chars.joinToString("");
OR convert chars
to CharArray
:
val result: String = String(chars.toCharArray());
OR declaring a primitive CharArray
by using charArrayOf
:
val chars = charArrayOf('A', 'B', 'C');
val result: String = String(chars);