riv*_*v94 1 scala tuples list
如果我(String,Double)在Scala中有一个元组列表(即List[(String,Double)]),我如何获得具有最大值的元组Double?
(String,Double)
List[(String,Double)]
Double
mar*_*ira 5
只需使用maxBy:
maxBy
val list: List[(String, Double)] = List(("a", 2.3), ("b", 3.5), ("c", 8.9)) list.maxBy(_._2)
归档时间:
9 年,7 月 前
查看次数:
535 次
最近记录: