MatchCollection.IList.Clear 方法

定義

移除集合的所有項目。

 virtual void System.Collections.IList.Clear() = System::Collections::IList::Clear;
void IList.Clear ();
abstract member System.Collections.IList.Clear : unit -> unit
override this.System.Collections.IList.Clear : unit -> unit
Sub Clear () Implements IList.Clear

實作

例外狀況

集合是唯讀的。

備註

這個成員是明確介面成員實作, 只有在 MatchCollection 執行個體轉換成 IList 介面時,才能使用這個成員。

此方法的實作可能會因處理 ICollection.Count 集合的 和 容量的方式而有所不同。 一般而言,計數會設定為零,而且也會釋放集合元素中其他物件的參考。 容量可以設定為零或預設值,也可以維持不變。

適用於