---
title: "remove(at:)"
framework: paperkit
role: symbol
role_heading: Instance Method
path: "paperkit/markuporderedset/remove(at:)"
---

# remove(at:)

Removes and returns the element at the specified position.

## Declaration

```swift
@discardableResult mutating func remove(at index: Int) -> MarkupOrderedSet.Element
```

## Parameters

- `index`: The position of the element to remove. index must be a valid index of the collection that is not equal to the collection’s end index.

## Return Value

Return Value The removed element.

## Discussion

Discussion The operation moves all elements following the specified position to close the resulting gap.

## See Also

### Removing elements

- [remove(_:)](paperkit/markuporderedset/remove(_:).md)
- [removeAll(where:)](paperkit/markuporderedset/removeall(where:).md)
- [removeElement(for:)](paperkit/markuporderedset/removeelement(for:)-4pqof.md)
- [removeElement(for:)](paperkit/markuporderedset/removeelement(for:)-5khjd.md)
- [removeStroke(for:)](paperkit/markuporderedset/removestroke(for:).md)
