FunVec1TGet Method
Safely gets the element at the i-th position; returns None if the index is invalid.
var underlyingArray = new int[] { 10, 11, 12 };
FunVec1<int> vec = new(underlyingArray);
Assert(jagvecged.Get(1) == Some(11));
Assert(vec.Get(-1).IsNone);
Assert(vec.Get(2).IsNone);
For other methods on the resulting optional, see
Opt.
Namespace: Orx.Fun.FunVecAssembly: Orx.Fun.FunVec (in Orx.Fun.FunVec.dll) Version: 1.0.0
public Opt<T> Get(
int i
)
- i Int32
- Index of the element to be retrieved.
OptT