                     options: .backwards,
                     range: NSRange(location: 0, length: NSMaxRange(textView.selectedRange))
                 )
-                filterString = mentionString.replacingOccurrences(of: trigger, with: "")
-                    .replacingOccurrences(of: "\n", with: "")
+                filterString = mentionString.filter { ![trigger, "\n"].contains(String($0)) }
 
                 if let filterString = filterString, !(cooldownTimer?.isValid ?? false) {
                     stringCurrentlyBeingFiltered = filterString

    private func activateCooldownTimer() {
        cooldownTimer?.invalidate()
        let timer = Timer(timeInterval: cooldownInterval, target: self,
                          selector: #selector(MentionListener.cooldownTimerFired(_:)), userInfo: nil,
                          repeats: false)
        cooldownTimer = timer
        RunLoop.main.add(timer, forMode: RunLoop.Mode.default)

    @discardableResult public func addMention(_ createMention: CreateMention) -> Bool {
        guard let currentMentionRange = currentMentionRange else { return false }

        mentions = mentions
            |> add(createMention, spaceAfterMention: spaceAfterMention, at: currentMentionRange)

        let (text, selectedRange) = mentionsTextView.attributedText
            |> add(createMention, spaceAfterMention: spaceAfterMention, at: currentMentionRange, with: mentionTextAttributes)
