StringCollection.IList.Remove(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從 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 不變。 沒例外拋出。
在連續元素的集合中,例如列表,緊接被移除元素後的元素會往上移動,佔據空出的位置。 若集合被索引,移動元素的索引也會同步更新。 此行為不適用於將元素概念上分組為桶的集合,例如雜湊表。
此方法透過呼叫 Object.Equals來判定等號。
此方法執行線性搜尋;因此,此方法是一個 O(n) 運算,其中 n 為 Count。