StringCollection.IList.Remove(Object) 方法

定義

StringCollection 移除特定物件之第一個符合的元素。

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

參數

value
Object

要從 Object 移除的 StringCollection。 這個值可以是 null

實作

例外狀況

StringCollection 為唯讀。

-或-

StringCollection 具有固定的大小。

備註

StringCollection如果 未包含指定的物件,則 StringCollection 會保持不變。 不會擲回任何例外狀況。

在相鄰元素的集合中,例如清單,接在移除的元素之後的元素會向上移動以佔用空出的位置。 如果集合具有索引,則移動之項目的索引也會更新。 集合的項目若在概念上群組成 Bucket (例如雜湊資料表),則不適用這項行為。

這個方法會呼叫 Object.Equals來判斷相等。

此方法會執行線性搜尋;因此,這個方法是 O (n) 作業,其中 nCount

適用於

另請參閱