append!

..  append!(collection, collection2) -> collection.

Add the elements of ``collection2`` to the end of ``collection``.

.. doctest::

   julia> append!([1],[2,3])
   3-element Array{Int64,1}:
    1
    2
    3

.. doctest::

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

Use :func:`push!` to add individual items to ``collection`` which are not
already themselves in another collection.
The result is of the preceding example is equivalent to
``push!([1, 2, 3], 4, 5, 6)``.

Examples

julia> foo = [1];
julia> append!(foo, [2,3]);             # contrast with push!

julia> foo
3-element Array{Int64,1}:
 1
 2
 3
julia> a= [1, 2, 3]
       b = [4, 5, 6]
       append!(a,b)
6-element Array{Int64,1}:
 1
 2
 3
 4
 5
 6

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: