---
title: "formIntersection(with:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutablecharacterset/formintersection(with:)"
---

# formIntersection(with:)

Modifies the receiver so it contains only characters that exist in both the receiver and another set.

## Declaration

```swift
func formIntersection(with otherSet: CharacterSet)
```

## Parameters

- `otherSet`: The character set with which to perform the intersection.

## See Also

### Combining Character Sets

- [formUnion(with:)](foundation/nsmutablecharacterset/formunion(with:).md)
