StringCollection.IList.Add(Object) メソッド

定義

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は読み取り専用です。

-又は-

StringCollectionには固定サイズがあります。

注釈

StringCollectionnull を有効な値として受け取り、重複する要素を許可します。

Countが既に容量と等しい場合は、内部配列を自動的に再割り当てすることでStringCollectionの容量が増え、新しい要素が追加される前に既存の要素が新しい配列にコピーされます。

Count容量より小さい場合、このメソッドは O(1) 操作です。 新しい要素に対応するために容量を増やす必要がある場合、このメソッドは O(n) 操作になり、 nCountされます。

適用対象

こちらもご覧ください