Modifier

Partager via


BoolExtensions.ToInt(Boolean) Method

Definition

Converts the given Boolean value into an Int32.

public static int ToInt (this bool flag);
static member ToInt : bool -> int
<Extension()>
Public Function ToInt (flag As Boolean) As Integer

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