chunked() extension function does exactly this: val str = "Hello World! Kotlin is amazing!" println(str.chunked(3)) // [Hel, lo , Wor, ld!, ...
確定! 回上一頁