在Scala中存在好几个Zip相关的函数,比如zip,zipAll,zipped 以及zipWithIndex等等。我们在代码中也经常看到这样的函数,这篇文章主要介绍一下这些函数的区别以及使用。 1、zip函数将传进来的两个参数中相应位置上的元素组成一个pair数组。如果其中一个参数元素比较长,那么多余的参数会被删掉。看下英文介绍吧: Returns a list formed from this list and another iterable collection by combining corresponding elemen...