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

# remove(at:)

Removes the element at the given index of the set.

## Declaration

```swift
@discardableResult mutating func remove(at position: Set<Element>.Index) -> Element
```

## Parameters

- `position`: The index of the member to remove. position must be a valid index of the set, and must not be equal to the set’s end index.

## Return Value

Return Value The element that was removed from the set.

## See Also

### Removing Elements

- [filter(_:)](swift/set/filter(_:).md)
- [remove(_:)](swift/set/remove(_:)-8p2tv.md)
- [remove(_:)](swift/set/remove(_:)-4d3i1.md)
- [removeFirst()](swift/set/removefirst().md)
- [removeAll(keepingCapacity:)](swift/set/removeall(keepingcapacity:).md)
