1
有相同尺寸的三种不同的序列过滤序列
a:int = {1, 2, 3, 4}
b:string= {"a","b","a","d"}
c:string= {"y","y","t","t"}
我如何从seq:a
创建一个新的序列与条件
where b="a" and c="y"
有相同尺寸的三种不同的序列过滤序列
a:int = {1, 2, 3, 4}
b:string= {"a","b","a","d"}
c:string= {"y","y","t","t"}
我如何从seq:a
创建一个新的序列与条件
where b="a" and c="y"
Seq.zip a (Seq.zip b c)
|> Seq.filter (snd >> ((=) ("a", "y")))
|> Seq.map fst
Seq.zip3 a b c
|> Seq.choose (function (n, "a", "y") -> Some n | _ -> None)
你应该得到的到底是什么? {1}? –