shift!

shift!(collection) -> item

Remove the first item from collection.

julia> A = [1, 2, 3, 4, 5, 6]
6-element Array{Int64,1}:
 1
 2
 3
 4
 5
 6

julia> shift!(A)
1

julia> A
5-element Array{Int64,1}:
 2
 3
 4
 5
 6

Examples

julia> a = [1, 2, 3]
       shift!(a)
1
julia> print(a)
[2,3]
julia> a = [1, 2, 3]
       shift!(a)
       shift!(a)
       print(a)
[3]
julia> foo = [1, 2, 3];
3-element Array{Int64,1}:
 1
 2
 3

julia> shift!(foo);
1

julia> foo
2-element Array{Int64,1}:
 2
 3

See Also

append!, delete!, deleteat!, empty!, endof, filter, filter!, gc, get!, getkey, haskey, insert!, isempty, keys, map, map!, merge, merge!, pop!, prepend!, push!, reduce, resize!, shift!, splice!, unshift!, values,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: