Export (0) Print
Expand All

BitConverter.ToBoolean Method

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

[Visual Basic]
Public Shared Function ToBoolean( _
   ByVal value() As Byte, _
   ByVal startIndex As Integer _
) As Boolean
[C#]
public static bool ToBoolean(
 byte[] value,
 int startIndex
);
[C++]
public: static bool ToBoolean(
 unsigned char value __gc[],
 int startIndex
);
[JScript]
public static function ToBoolean(
   value : Byte[],
 startIndex : int
) : Boolean;

Parameters

value
An array of bytes.
startIndex
The starting position within value.

Return Value

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

Exceptions

Exception Type Condition
ArgumentNullException value is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeException startIndex is less than zero or greater than the length of value minus 1.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

BitConverter Class | BitConverter Members | System Namespace

Show:
© 2015 Microsoft