How to print a set in VB.NET

2 Answers

0 votes
Imports System
Imports System.Collections.Generic

Public Class Program
    Public Shared Sub Main(ByVal args As String())
        Dim _set As ISet(Of String) = New HashSet(Of String) From {
            "c#",
            "vb.net",
            "c",
            "c++",
			"java"	
        }
        Console.WriteLine(String.Join(" ", _set))
    End Sub
End Class





' run:
'
' c# vb.net c c++ java
'

 



answered Jul 16, 2022 by avibootz
0 votes
Imports System
Imports System.Collections.Generic

Public Class Program
    Public Shared Sub Main(ByVal args As String())
        Dim _set As ISet(Of String) = New HashSet(Of String) From {
            "c#",
            "vb.net",
            "c",
            "c++",
			"java"
        }
        
        For Each item As String In _set
            Console.WriteLine(item)
        Next
    End Sub
End Class





' run:
'
' c#
' vb.net
' c
' c++
' java
'

 



answered Jul 16, 2022 by avibootz

Related questions

...