update code to Swift 4.1

This commit is contained in:
Yonas Kolb
2018-09-10 20:59:02 +10:00
parent adb443229d
commit 420c0eacd7
7 changed files with 18 additions and 18 deletions

View File

@@ -13,7 +13,7 @@ extension String {
let specialCharacters = ",|:"
func appendWord(_ word: String) {
if components.count > 0 {
if let precedingChar = components.last?.characters.last, specialCharacters.characters.contains(precedingChar) {
if let precedingChar = components.last?.last, specialCharacters.contains(precedingChar) {
components[components.count-1] += word
} else if specialCharacters.contains(word) {
components[components.count-1] += word
@@ -25,7 +25,7 @@ extension String {
}
}
for character in self.characters {
for character in self {
if character == "'" { singleQuoteCount += 1 }
else if character == "\"" { doubleQuoteCount += 1 }