BitArray.Item[Int32] 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定該位元在特定位置 BitArray的值。
public:
property bool default[int] { bool get(int index); void set(int index, bool value); };
public bool this[int index] { get; set; }
member this.Item(int) : bool with get, set
Default Public Property Item(index As Integer) As Boolean
參數
- index
- Int32
這是要取得或設定的值的零基指數。
屬性值
位置位 index元的值。
例外狀況
備註
此特性可透過以下語法存取集合中的特定元素: myCollection[index]。
C# 語言使用 this 關鍵字來定義索引器,而非實作該 Item[] 屬性。 Visual Basic 作為 Item[] 預設屬性實作,提供相同的索引功能。
取得此屬性的值是一個 O(1) 操作;設定該屬性也是一個 O(1) 操作。