RosettaCodeData/Task/Loops-With-multiple-ranges/Visual-Basic-.NET/loops-with-multiple-ranges-5.vb

5 lines
285 B
VB.net
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
Function Range(ParamArray ranges() As (start As Integer, [stop] As Integer, [step] As Integer)) As IEnumerable(Of Integer)
' Note: SelectMany is equivalent to bind, flatMap, etc.
Return ranges.SelectMany(Function(r) Range(r.start, r.stop, r.step))
End Function