什么是最好的Scala方法从一些列表中替换元素x的每个出现的一些其他元素y?这就是我现在正在做的事情:
list map { case `x` => y case a => a }
有更简洁的方法吗?谢谢.
scala list
list ×1
scala ×1