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