---
title: "remove(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nscountedset/remove(_:)"
---

# remove(_:)

Removes a given object from the set.

## Declaration

```swift
func remove(_ object: Any)
```

## Parameters

- `object`: The object to remove from the set.

## Discussion

Discussion If object is present in the set, decrements the count associated with it. If the count is decremented to 0, object is removed from the set. remove(_:) does nothing if object is not present in the set.

## See Also

### Related Documentation

- [count(for:)](foundation/nscountedset/count(for:).md)

### Adding and Removing Entries

- [add(_:)](foundation/nscountedset/add(_:).md)
