Modifier

Partager via


BoolExtensions.ToByte(Boolean) Method

Definition

Converts the given Boolean value into a Byte.

public static byte ToByte (this bool flag);
static member ToByte : bool -> byte
<Extension()>
Public Function ToByte (flag As Boolean) As Byte

Parameters

flag
Boolean

The input value to convert.

Returns

1 if flag is true, 0 otherwise.

Remarks

This method does not contain branching instructions.

Applies to