Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
将集合拆分为两个集合的最佳方法是什么:一个包含满足谓词的所有元素,其余的?
val nums = List[Integer](1,2,3,4) val (evens, odds) = nums.split(_ % 2 == 0)