Fix more warnings

This commit is contained in:
Ali
2021-08-05 01:42:59 +02:00
parent 194f25d4e4
commit 31bc746984
253 changed files with 914 additions and 1063 deletions

View File

@@ -82,7 +82,7 @@ extension String {
var pureNumber = self.replacingOccurrences( of: "[^0-9]", with: "", options: .regularExpression)
for index in 0 ..< pattern.count {
guard index < pureNumber.count else { return pureNumber }
let stringIndex = String.Index(encodedOffset: index)
let stringIndex = pattern.index(pattern.startIndex, offsetBy: index)
let patternCharacter = pattern[stringIndex]
guard patternCharacter != replacementCharacter else { continue }
pureNumber.insert(patternCharacter, at: stringIndex)