Zip elements with odd and even indices in a list
Posted
by Alexander Temerev
on Stack Overflow
See other posts from Stack Overflow
or by Alexander Temerev
Published on 2010-04-08T16:19:23Z
Indexed on
2010/04/08
16:23 UTC
Read the original article
Hit count: 278
scala
|functional-programming
I want to zip even and odd elements in a list to make a list of pairs, like that:
["A", "B", "C", "D", "E", "F"] -> [("A", "B"), ("C", "D"), ("E", "F")]
What is the most concise expression to do this in elegant in functional way?
© Stack Overflow or respective owner