C# 中 BitArray 類的 Length 屬性是什麼?
Length 屬性用於獲取或設定 BitArray 中的元素數。
我們的 BitArray。
BitArray arr = new BitArray( 5 );
使用 Length 屬性計算長度。
Console.WriteLine( "Length: {0}", arr.Length );您可以嘗試執行以下程式碼以瞭解如何使用 BitArray 類的 Length 屬性。
示例
using System;
using System.Collections;
public class Demo {
public static void Main() {
BitArray arr = new BitArray( 5 );
Console.WriteLine( "Count: {0}", arr.Count );
Console.WriteLine( "Length: {0}", arr.Length );
}
}輸出
Count: 5 Length: 5
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP