first

Get the first element in range assuming it to be non-empty.

ElementType!Range
first
(
Range
)
(
Range range
)
if (
isInputRange!Range
)

Examples

assert(first([1, 2, 3]) == 1);
assert(first("abcd") == 'a');

Meta