OptionExtensionsLinqGetT(T, Int32) Method
Returns Some of the element at the given
index of the
array if it is a valid index; None otherwise.
Assert(Array.Empty<Title>().Get(1).IsNone);
Assert((new int[2] { 1, 2 }).Get(2) == Some(1));
Assert((new int[2] { 1, 2 }).Get(0) == Some(1));
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public static Opt<T> Get<T>(
this T[] array,
int index
)
- array T
- Array.
- index Int32
- Index of the element to return.
- T
[Missing <typeparam name="T"/> documentation for "M:Orx.Fun.Option.OptionExtensionsLinq.Get``1(``0[],System.Int32)"]
OptTIn Visual Basic and C#, you can call this method as an instance method on any object of type
T. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).