Imports System
Imports System.Collections.Generic
Class Program
Public Shared Sub Main()
Dim numbers As HashSet(Of Integer) = New HashSet(Of Integer) From {
1,
2,
3,
4,
5,
6
}
Dim isRemoved As Boolean = numbers.Remove(3)
Console.WriteLine(If(isRemoved, "Element removed.", "Element not found."))
For Each number In numbers
Console.WriteLine(number)
Next
End Sub
End Class
' run:
'
' Element removed.
' 1
' 2
' 4
' 5
' 6
'