问题描述:

How can I convert a map to a list without the map keys being involved in the list in scala?

val mp = collection.mutable.Map[Long, String]()

mp(0) = "val0"

mp(1) = "val1"

mp(2) = "val2"

mp.toList //I want: List("val0", "val1", "val2")

网友答案:

You are probably looking for

mp.values.toList
相关阅读:
Top