RosettaCodeData/Task/Loops-With-multiple-ranges/Visual-Basic-.NET/loops-with-multiple-ranges-5.vb
2023-07-01 13:44:08 -04:00

4 lines
285 B
VB.net

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