Mega Code Archive

 
Categories / VB.Net / Data Structure
 

The Values property is an efficient way to retrieve values by index

Imports System Imports System.Collections.Generic Public Class Example     Public Shared Sub Main()         Dim openWith As New SortedList(Of String, String)         openWith.Add("A", "a")         openWith.Add("B", "b")         openWith.Add("C", "c")         openWith.Add("D", "d")         Console.WriteLine(vbLf & "Indexed retrieval using the " & _             "Values property: Values(2) = {0}", openWith.Values(2))     End Sub End Class