Join Slack
Powered by
It there a convenient way to split a list of items...
# announcements
e
edwardwongtl
11/20/2017, 7:27 AM
It there a convenient way to split a list of items into many smaller list of n items? e.g. a list of 100 items into 5 list of 20 items
g
gildor
11/20/2017, 7:32 AM
Only in Kotlin 1.2. You can use chunked(n)
e
edwardwongtl
11/20/2017, 7:34 AM
So no easy way in 1.1 then?
g
gildor
11/20/2017, 7:35 AM
https://stackoverflow.com/questions/34498368/kotlin-convert-large-list-to-sublist-of-set-partition-size
e
edwardwongtl
11/20/2017, 7:44 AM
Thanks man
2
Views
Open in Slack
Previous
Next