How to create a list of keys from Dictionary.Keys in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim dictionary As New Dictionary(Of Integer, Boolean)

        dictionary.Add(13, True)
        dictionary.Add(99, False)
        dictionary.Add(100, True)

        Dim list As New List(Of Integer)(dictionary.Keys)

        For Each n In list
            Console.WriteLine(n)
        Next

    End Sub

End Module

' run:
' 
' 13
' 99
' 100

 



answered Feb 2, 2017 by avibootz

Related questions

...