ICollection<T>.Clear Method

Definition

ICollection<T> 移除所有項目。Removes all items from the ICollection<T>.

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

Exceptions

ICollection<T> 是唯讀的。The ICollection<T> is read-only.

Remarks

Count 必須設定為0,而且必須釋放集合元素的其他物件參考。Count must be set to 0, and references to other objects from elements of the collection must be released.

Applies to

See also