chunked

Splits this char sequence into a list of strings each not exceeding the given size.

fun CharSequence.chunked(size: Int): List<String>(source)
val text = "abcdefghijklmnopqrstuvwxyz"
val chunks = text.chunked(5)
println(chunks) // [abcde, fghij, klmno, pqrst, uvwxy, z]

Source