Zip multiple sequences

后端 未结 7 1736
眼角桃花
眼角桃花 2020-12-06 09:20

I am trying to zip multiple sequences to form a long tuple:

val ints = List(1,2,3)
val chars = List(\'a\', \'b\', \'c\')
val strings = List(\"Al         


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 09:40

    Here is another solution which would work for your problem.

    ints zip chars zip strings zip bools map{ case (((a, b), c), d) => (a,b,c,d)}
    

提交回复
热议问题