                 return ""
             }
             if text.hasSuffix(parkedText) {
-                return String(text[text.startIndex..<text.characters.index(text.endIndex, offsetBy: -parkedText.characters.count)])
+                return String(text[text.startIndex..<text.index(text.endIndex, offsetBy: -parkedText.count)])
             } else {
                 return text
             }

    
    var beginningOfParkedText: UITextPosition? {
        get {
            return position(from: endOfDocument, offset: -parkedText.characters.count)
        }
    }
    

    
    @objc func textChanged(_ sender: UITextField) {
        switch typingState {
        case .start where text!.count > 0:
            text = typedText + parkedText
            updateAttributedTextWith(text!)
            prevText = text!
