Module Module1
Sub Main()
' Create new SortedSet.
Dim sorted = New SortedSet(Of String)()
sorted.Add(
"carrot")
sorted.Add(
"apple")
sorted.Add(
"bird")
' Loop over items in SortedSet.
For Each item As String In sorted
Console.WriteLine(
"SORTEDSET: {0}", item)
Next
' See if SortedSet contains a string.
If sorted.Contains(
"bird") Then
Console.WriteLine(
"CONTAINS bird")
End If
End Sub
End Module
SORTEDSET: apple
SORTEDSET: bird
SORTEDSET: carrot
CONTAINS bird