Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,941 questions

51,879 answers

573 users

How to use Array.GetEnumerator() method to get an IEnumerator for an Array in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()
        Dim s() As String = {"PHP", "C", "C++", "C#", "Java", "JavaScript",
                             "VB.NET", "VB6", "Pascal", "Objective-C", "Python"}

        Dim i As Integer = 0
        Dim sEnumerator As System.Collections.IEnumerator = s.GetEnumerator()

        While (sEnumerator.MoveNext())
            Console.WriteLine("s({0}) {1}", i, sEnumerator.Current)
            i += 1
        End While
    End Sub

End Module

' run:
' 
' s(0) PHP
' s(1) C
' s(2) C++
' s(3) C#
' s(4) Java
' s(5) JavaScript
' s(6) VB.NET
' s(7) VB6
' s(8) Pascal
' s(9) Objective-C
' s(10) Python

 



answered Apr 23, 2016 by avibootz
...