How to create, use and print SortedList in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim list As SortedList(Of String, String) =
                New SortedList(Of String, String)

        list.Add("vb.net", "w8")
        list.Add("java", "d6")
        list.Add("php", "l2")
        list.Add("python", "q3")
        list.Add("c#", "p2")

        For Each pair As KeyValuePair(Of String, String) In list
            Console.WriteLine(pair.Key + " : " + pair.Value)
        Next

    End Sub

End Module


' run:
' 
' c# : p2
' java: d6
' php: l2
' python: q3
' vb.net : w8

 



answered Oct 16, 2018 by avibootz

Related questions

1 answer 100 views
100 views asked Aug 21, 2024 by avibootz
3 answers 299 views
4 answers 373 views
1 answer 176 views
2 answers 206 views
3 answers 225 views
...