How to clear a List (remove all items) in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim list As New List(Of Integer)

        list.Add(1)
        list.Add(43)
        list.Add(7)
        list.Add(999)
        list.Add(10101)

        list.Clear()

        Console.WriteLine(list.Count)

    End Sub

End Module

' run:
' 
' 0

 



answered Feb 1, 2017 by avibootz
...