unshift!

unshift!(collection, items...) -> collection

Insert one or more items at the beginning of collection.

  julia> unshift!([1, 2, 3, 4], 5, 6)
  6-element Array{Int64,1}:
   5
   6
   1
   2
   3
   4

Examples

julia> a = [1, 2, 3]
       unshift!(a,7)
4-element Array{Int64,1}:
 7
 1
 2
 3
julia> a = [1, 2, 3]
       unshift!(a,7,2)
5-element Array{Int64,1}:
 7
 2
 1
 2
 3
julia> foo = [1,2,3];

julia> unshift!(foo, 5, 6);

julia> foo
5-element Array{Int64,1}:
 5
 6
 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: