How to iterate over a set in VB.NET

1 Answer

0 votes
Imports System
Imports System.Collections.Generic

Public Class Program
    Public Shared Sub Main(ByVal args As String())
        Dim st As ISet(Of String) = New HashSet(Of String)()
		
        st.Add("Java")
        st.Add("C++")
        st.Add("Python")
        st.Add("C")
        st.Add("C#")
		st.Add("VB.NET")

        For Each s As String In st
            Console.WriteLine(s)
        Next
    End Sub
End Class




' run:
'
' Java
' C++
' Python
' C
' C#
' VB.NET
'

 



answered Aug 11, 2022 by avibootz

Related questions

...