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.
次のコードがあります。
let s1 = [(12, "abcde12345"); (23, "bcdef2345"); (12, "xyzafg3838")] let s2 = ["bcd"; "345"]
s12 番目のアイテムが のいずれかの部分文字列を持つすべてのアイテムを見つける最良の方法は何s2ですか?
s1
s2
(12、「abcde12345」); (23、「bcdef2345」)
私の実際のコードでは、s1 はSeq.
Seq
私は1つを考え出しました。
s1 |> Seq.filter (fun i -> List.exists (fun e -> (snd i).Contains(e)) s2)