Collection.IList.Remove(Object) 方法

定義

Collection 物件中移除第一次出現的特定物件。

 virtual void IListRemove(System::Object ^ value) = System::Collections::IList::Remove;
void IList.Remove (object value);
abstract member IListRemove : obj -> unit
override this.IListRemove : obj -> unit
Sub IListRemove (value As Object) Implements IList.Remove

參數

value
Object

要從 Object 物件中移除的 Collection

例外狀況

Collection 物件為唯讀。

-或-

Collection 物件具有固定的大小。

備註

在相鄰元素的集合中,例如清單,接在移除的元素之後的元素會向上移動以佔用空出的位置。 如果集合具有索引,則移動之項目的索引也會更新。 集合的項目若在概念上群組成 Bucket (例如雜湊資料表),則不適用這項行為。 如果在 value 物件中 Collection 找不到 ,物件 Collection 會保持不變,而且不會擲回例外狀況。

適用於

另請參閱