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

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,037 questions

40,897 answers

573 users

What is the equivalent of Python set(string) in VB.NET

1 Answer

0 votes
Imports System
Imports System.Collections.Generic

Public Class Program
    Public Shared Function makeset(ByVal str As String) As HashSet(Of Char)
        Dim arr As Char() = str.ToCharArray()
        
		Dim hset = New HashSet(Of Char)(arr)

        Return hset
    End Function

    Public Shared Sub Main(ByVal args As String())
		Dim str As String = "VB.NET Programming"
	
        Console.WriteLine(String.Join(",", makeset(str)))
    End Sub
End Class



' run:
'
' V,B,.,N,E,T, ,P,r,o,g,a,m,i,n
'

 





answered Feb 7 by avibootz

Related questions

1 answer 43 views
43 views asked Aug 17, 2023 by avibootz
2 answers 39 views
1 answer 65 views
1 answer 63 views
1 answer 68 views
68 views asked Mar 8, 2021 by avibootz
...