Join Slack
Powered by
Is there anything that might allow me to take a Li...
# arrow
j
jeremy
03/20/2019, 1:11 AM
Is there anything that might allow me to take a List<String> and convert it to a List<Tuple2<String, String>> where it pairs elements and if odd <String, Null> ?
s
streetsofboston
03/20/2019, 1:26 AM
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/fold-indexed.html
and start with a
listOf<Pair<String?,String?>>()
j
jeremy
03/20/2019, 1:45 AM
Thanks 👍
jeremy
03/20/2019, 1:46 AM
Just found this listOf(strs).zipWithNext()
💯 2
2
Views
Open in Slack
Previous
Next