The “set” part of CharacterSet refers not to Set from the Swift standard library, but instead to the SetAlgebraprotocol, which bestows the type with the same interface: contains(_:)insert(_:)union(_:)intersection(_:), and so on. CharacterSet - NSHipster