How to print a range of integers from a List of integers in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim list As New List(Of Integer)

        list.Add(1)
        list.Add(43)
        list.Add(7)
        list.Add(85)
        list.Add(999)

        For Each n In list.GetRange(0, 2)
            Console.WriteLine(n)
        Next

    End Sub

End Module

' run:
' 
' 1
' 43



answered Feb 2, 2017 by avibootz
...