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.
我们有一个项目列表,我们想逐个元素地与另一个项目列表进行比较,结果是一个列表中的项目在两个列表中都没有项目或重复项目。
例如:
L1={S1,S2,S3,S4,S5,S6,S7,S8,S9,S10},L2={S1,S4,S7,S9},列表结果={S2,S3,S5,S6,S8,S10 }
提供的描述还不够好,无论如何我都会尝试为您找出解决方案:
let L1 : Sequence(String) = Sequence {'1', '2', '3', '4', '5', '6', '7', '8', '9', '10'}, L2 : Sequence(String) = Sequence {'1', '4', '7', '9' } in L1->reject(x | L2->includes(x)) results: '2' '3' '5' '6' '8' '10'