Project: Array Utilities Unit
Unit: DelphiDabbler.Lib.ArrayUtils
Record: TArrayUtils
Applies to: ~>0.1
class function First<T>(const A: array of T): T;
static;Returns the first element of a non-empty array.
Parameters:
- A - The array on which to operate.
Returns:
- The required first element.
Precondition:
- A must not be empty. An EAssertionFailed exception is raised otherwise.
procedure First_Eg;
var
A: TArray<Integer>;
begin
A := TArray<Integer>.Create(1, 2, 3);
Assert(TArrayUtils.First<Integer>(A) = 1);
end;