ICollection<T>.Clear 方法

定义

ICollection<T> 中移除所有项。Removes all items from the ICollection<T>.

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

异常

ICollection<T> 为只读。The ICollection<T> is read-only.

注解

Count 必须设置为 0,并且必须释放集合中的元素对其他对象的引用。Count must be set to 0, and references to other objects from elements of the collection must be released.

适用于

另请参阅