OptTUnwrap Method

Overload List

Unwrap Returns the underlying value when IsSome; or throws when IsNone. Must be called shyly, as it is not necessary to unwrap until the final result is achieved due to Map, FlatMap and TryMap methods.
C#
Opt<int> optAge = "42".ParseIntOrNone();
if (optAge.IsSome) {
    int age = optAge.Unwrap(); // use the uwrapped age
} else { // handle the None case
}
Unwrap(String) Similar to Unwrap method except that the errorMessageIfNone is appended to the error message if IsNone.

See Also