Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
Array

Method Array.shift()


Method shift

array shift(array list)

Description

Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down. If there are no elements in the array it returns 0. Returns an array where the first element is the shifted value and the second element is the modified array.

Example

Array.shift(({ "a", "b", "c", "d"})); > ({ "a", ({ "b", "c", "d" }) })

See also

ADT.Stack