How to collect non-null values from a list of Option in Scala?

前端 未结 0 1327
半阙折子戏
半阙折子戏 2021-01-27 09:23

What is the best way to convert a list of Option[T] to a list of T where the option is not None? E.g. I want to go from this:

scala>         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题