Collection.Clear 方法

定義

刪除 Visual Basic Collection 物件的所有項目。Deletes all elements of a Visual Basic Collection object.

public:
 void Clear();
public void Clear ();
member this.Clear : unit -> unit
Public Sub Clear ()

實作

範例

Dim customers As New Microsoft.VisualBasic.Collection()
' Insert code that adds customers to collection.
customers.Clear()

備註

Clear 方法會將集合清空,並將其 Count 屬性重設為0。The Clear method empties the collection and resets its Count property to 0.

適用於