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