             return nil
         }
     }
-}
-
-extension String {
-    subscript (i: Int) -> Character {
-        return self[advance(self.startIndex, i)]
-    }
-
-    subscript (i: Int) -> String {
-        return String(self[i] as Character)
-    }
-
-    subscript (r: Range<Int>) -> String {
-        return substringWithRange(Range(start: advance(startIndex, r.startIndex), end: advance(startIndex, r.endIndex)))
-    }
-}
+}
        switch typingState {
        case .Start where count(text) > 0:
            notParkedText = text
            
            let attributedString = NSMutableAttributedString(string: text + parkedText)
            attributedString.addAttributes(parkedTextAttributes, range: NSMakeRange(count(text), count(parkedText)))
            attributedText = attributedString

            prevText = text

            // Reset to prevText if you tried to change parkedText.
            if !text.hasSuffix(parkedText) {
                let attributedString = NSMutableAttributedString(string: prevText)

                let range = prevText.rangeOfString(parkedText, options: NSStringCompareOptions.BackwardsSearch, range: nil, locale: nil)
                let nsrange = NSRangeFromRange(prevText, range: range!)

                attributedString.addAttributes(parkedTextAttributes, range: nsrange)
                attributedText = attributedString
            } else {
                prevText = text

                notParkedText = text[text.startIndex..<advance(text.endIndex, -count(parkedText))]
            }
            goToBeginningOfConstantText()

