     func unformat(_ format: String, oldString: String) -> String {
         var string: String = self
         var undefineChars = [String]()
-        for i in 0..<format.characters.count {
+        for i in 0..<format.count {
             let unicharFormatString = format[i]
             let charFormatString = unicharFormatString
             let charFormatStringUpper = unicharFormatString.uppercased()

    fileprivate func regexControlString(pattern: String) -> Bool {
        do {
            let regex = try NSRegularExpression(pattern: pattern, options: [])
            let numberOfMatches = regex.numberOfMatches(in: self, options: [], range: NSRange(location: 0, length: self.characters.count))
            return numberOfMatches == self.characters.count
        } catch {
            return false
        }

            }

            newString += stringToAdd
            if counter == stringUnformated.count {
                if i == format.count - 2 {
                    let lastUnicharFormatString = format[i + 1]
                    let lastCharFormatStringUpper = lastUnicharFormatString.uppercased()
                    let lasrCharControl = (!(lastCharFormatStringUpper == String.ONLY_CHAR_UPPER) &&
