unzip3
方法(或屬性)屬於 scala.collection.View.ZipWithIndex
類(class),其相關用法說明如下。
用法:
def unzip3[A1, A2, A3](implicit asTriple: ((A, Int)) => (A1, A2, A3)): (View[A1], View[A2], View[A3])
將此三元組的可迭代集合轉換為每個三元組的第一個、第二個和第三個元素的三個集合。
val xs = Iterable(
(1, "one", '1'),
(2, "two", '2'),
(3, "three", '3')).unzip3
// xs == (Iterable(1, 2, 3),
// Iterable(one, two, three),
// Iterable(1, 2, 3))
類型參數:
- A1
元素三元組的第一個成員的類型
- A2
元素三元組的第二個成員的類型
- A3
元素三元組的第三個成員的類型
值參數:
- asTriple
一個隱式轉換,它斷言這個可迭代集合的元素類型是三元組。
返回:
可迭代集合的三元組,分別包含此可迭代集合的每個元素三元組的第一個、第二個和第三個成員。
繼承自:
- collection.IterableOps.unzip3
源碼:
- Iterable.scala
相關用法
- Scala ZipWithIndex.unzip用法及代碼示例
- Scala ZipWithIndex.inits用法及代碼示例
- Scala ZipWithIndex.partitionMap用法及代碼示例
- Scala ZipWithIndex.scanRight用法及代碼示例
- Scala ZipWithIndex.transpose用法及代碼示例
- Scala ZipWithIndex.groupMap用法及代碼示例
- Scala ZipWithIndex.tails用法及代碼示例
- Scala ZipWithIndex.sliding用法及代碼示例
- Scala ZipWithIndex.sizeIs用法及代碼示例
- Scala ZipWithIndex.lazyZip用法及代碼示例
- Scala ZipWithIndex.sizeCompare用法及代碼示例
- Scala ZipWithIndex.collectFirst用法及代碼示例
- Scala ZipWithIndex.addString用法及代碼示例
- Scala ZipWithIndex.groupBy用法及代碼示例
- Scala ZipWithIndex.mkString用法及代碼示例
- Scala ZipWithIndex.groupMapReduce用法及代碼示例
- Scala ZippedIterable2.unzip用法及代碼示例
- Scala ZippedIterable2.addString用法及代碼示例
- Scala ZipAll.groupBy用法及代碼示例
- Scala ZippedIterable3.transpose用法及代碼示例
- Scala ZipAll.unzip用法及代碼示例
- Scala ZippedIterable3.inits用法及代碼示例
- Scala Zip.transpose用法及代碼示例
- Scala ZipAll.addString用法及代碼示例
- Scala ZipAll.inits用法及代碼示例
注:本文由純淨天空篩選整理自scala-lang.org大神的英文原創作品 ZipWithIndex.unzip3。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。