BitConverter.ToBoolean Method (Byte[], Int32)

 

Returns a Boolean value converted from the byte at a specified position in a byte array.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member ToBoolean : 
        value:byte[] *
        startIndex:int -> bool

Parameters

value
Type: System.Byte[]

A byte array.

startIndex
Type: System.Int32

The index of the byte within value.

Return Value

Type: System.Boolean

true if the byte at startIndex in value is nonzero; otherwise, false.

Exception Condition
ArgumentNullException

value is null.

ArgumentOutOfRangeException

startIndex is less than zero or greater than the length of value minus 1.

To convert a Boolean value to its byte representation, call the ToBoolean method.

The following code example converts elements of Byte arrays to Boolean values with the ToBoolean method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: