ArrayList.GetEnumerator returns an enumerator for a range of elements in the ArrayList.
Imports System
Imports System.Collections
Class Program
Public Shared Sub Main()
Dim colors As New ArrayList()
colors.Add("red")
colors.Add("blue")
colors.Add("green")
Dim e As IEnumerator = colors.GetEnumerator()
While e.MoveNext()
Dim obj As [Object] = e.Current
Console.WriteLine(obj)
End While
Console.WriteLine()
Dim e2 As IEnumerator = colors.GetEnumerator(2, 4)
While e2.MoveNext()
Dim obj As [Object] = e2.Current
Console.WriteLine(obj)
End While
End Sub
End Class