StringCollection.IList.Add(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將物件加入至 StringCollection的結尾。
virtual int System.Collections.IList.Add(System::Object ^ value) = System::Collections::IList::Add;
int IList.Add(object value);
int IList.Add(object? value);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (value As Object) As Integer Implements IList.Add
參數
- value
- Object
Object將 加入 StringCollection。 其值可以是 null。
傳回
StringCollection該指數被加入的索引value。
實作
例外狀況
備註
StringCollection 接受 null 為有效值,並允許重複元素。
如果 Count 已經等於容量, StringCollection 則會自動重新配置內部陣列,並先複製現有元素到新陣列,然後再加入新元素。
若 Count 小於容量,此方法為 O(1) 操作。 若需增加容量以容納新元素,此方法將成為 O(n) 運算,其中 n 為 Count。