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

# contains(_:)

Returns a Boolean value that indicates whether the hash table contains a given object.

## Declaration

```swift
func contains(_ anObject: ObjectType?) -> Bool
```

## Parameters

- `anObject`: The object to test for membership in the hash table.

## Return Value

Return Value true if the hash table contains anObject, otherwise false.

## Discussion

Discussion The equality test used depends on the personality option selected. For instance, choosing the objectPersonality option will use isEqual: to determine equality. See NSPointerFunctions.Options for more information on personality options and their corresponding equality tests.

## See Also

### Accessing Content

- [anyObject](foundation/nshashtable/anyobject.md)
- [allObjects](foundation/nshashtable/allobjects.md)
- [setRepresentation](foundation/nshashtable/setrepresentation.md)
- [count](foundation/nshashtable/count.md)
- [member(_:)](foundation/nshashtable/member(_:).md)
- [objectEnumerator()](foundation/nshashtable/objectenumerator().md)
