问题
I need to define a function, which takes a sequence
and integers i
and n
as parameters and returns sub list or sub sequence of this seq, defined as followed:
.
回答1:
You can write:
let subSeq i n = Seq.skip i >> Seq.take n
Which is used, e.g.:
let result = subSeq 5 10 [0..20]
来源:https://stackoverflow.com/questions/34093543/f-take-subsequence-of-a-sequence