             }
 
             newString += stringToAdd
-            if counter == stringUnformated.characters.count {
-                if i == format.characters.count - 2 {
+            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) &&

                }
            }
        }
        if oldString.characters.count - 1 == string.characters.count {
            var changeCharIndex = 0
            for i in 0..<string.characters.count {
                let unicharString = string[i]
                let charString = unicharString
                let unicharString2 = oldString[i]

    }

    subscript (r: Range<Int>) -> String {
        let range = Range(uncheckedBounds: (lower: max(0, min(count, r.lowerBound)),
                                            upper: min(count, max(0, r.upperBound))))
        let start = index(startIndex, offsetBy: range.lowerBound)
        let end = index(start, offsetBy: range.upperBound - range.lowerBound)
        return String(self[Range(start ..< end)])
    }
}
