Note that this will remove anything that isn't a letter. That is, numbers will also be trimmed out. It may be what you want, but you should be aware of it. There are other predefined character sets you can use, or you can create your own from a list of valid characters.
I think you're best off just using String.removeAll(where:). String.trimmingCharacters(in:) is relatively slow and unnecessarily complex for this purpose, and as mentioned above, it probably stomps on things you probably don't want to touch.