【发布时间】:2013-04-13 09:53:58
【问题描述】:
我正在尝试编写一个函数来比较相似类型的元组。
def compareTuples(tuple1: (String, String, Int), tuple2: (String, String, Int)): (String, String, Int) = {
// if tuple1.Int < tuple2.Int return tuple1 else tuple2.
}
如何访问每个元组中的第三个元素或 int?
谢谢
【问题讨论】:
-
这应该解释你需要知道的一切tutorialspoint.com/scala/scala_tuples.htm
标签: scala pattern-matching tuples