deleteat!(collection, index::Integer)
deleteat!(collection, index)
Remove the item at the given index
and return the modified collection
.
Subsequent items are shifted to fill the resulting gap.
julia> deleteat!([6, 5, 4, 3, 2, 1], 2)
5-element Array{Int64,1}:
6
4
3
2
1
Examples
julia> foo = [6, 5, 4, 3, 2, 1];
julia> deleteat!(foo, 5);
julia> foo
5-element Array{Int64,1}:
6
5
4
3
1
julia> deleteat!(foo, 2:2:5); # sorted and unique itr
julia> foo
3-element Array{Int64,1}:
6
4
1
julia> deleteat!([6, 5, 4, 3, 2, 1], 2)
5-element Array{Int64,1}:
6
4
3
2
1
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.