共用方式為


Collection.Clear 方法

定義

刪除 Visual Basic Collection 物件的所有元素。

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。

適用於