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}, listresult={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'