Mega Code Archive

 
Categories / VB.Net / Data Structure
 

If a key does not exist, setting the default Item property for that key adds a new keyvalue pair

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")         openWith("doc") = "winword.exe"     End Sub End Class