Iterate
Apply an action to the option value when IsSome
.
Parameters | Returns |
---|---|
Action<T> action Option<T> option |
void |
Usage
This function is an alternative to Map
functions to apply an Action
rather a Func
delegate.
When the option value IsSome
Option<string> optionValue = "Hello Dev";
optionValue.Iterate(value => Console.WriteLine(value));
//"Hello Dev"