Count

Evaluates a Match method that returns one when the option IsSome, otherwise returns 0

Parameters

Returns

Option<T> option

int

Usage

When the option value IsSome

Option<double> optionValue = 42.0;
int count = optionValue.Count();

//count = 1

When the option value IsNone

Option<int> optionValue = Option<int>.None();
int count = optionValue.Count();

//count = 0

Last updated