Kotlin Program to Convert Character to String and Vice-Versa. If you want to convert the String to a char array, try calling. toCharArray() on the String. If the string is 1 character long, just take that character.
Kotlin Program to Convert Character to String and Vice-Versa
Source Code
fun main(args: Array<String>) {
val ch = 'c'
val st = Character.toString(ch)
// Alternatively
// st = String.valueOf(ch);
println("The string is: $st")
}
Output
Kotlin Program to Convert Character to String and Vice-Versa