Option[T]
- typeOption[T]
An optional value.
The
Option[T]is a variant type with two constructors:Some(T)andNone. To get the value of anOption, you can either match on it or use the?operator.The notation
T?is shorthand forOption[T].For more information, see the language reference.