toList
Returns a List containing all characters.
fun CharSequence.toList(): List<Char>(source)
val str = "Hello, Kotlin!"
val charList = str.toList()
println(charList) // [H, e, l, l, o, ,, , K, o, t, l, i, n, !]
Returns a List containing all characters.
fun CharSequence.toList(): List<Char>(source)
val str = "Hello, Kotlin!"
val charList = str.toList()
println(charList) // [H, e, l, l, o, ,, , K, o, t, l, i, n, !]