Contents

remove(at:)

Removes and returns the element at the specified position.

Declaration

@discardableResult mutating func remove(at index: Int) -> Element

Parameters

  • index:

    The position of the element to remove. index must be a valid index of the array that is not equal to the end index.

Return Value

The removed element.

Discussion

All the elements following the specified position are moved to close the gap.