             let comment: String
             switch platform {
             case .Android:
-                let commentForAndroid = key.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "/"))
+                let commentForAndroid = key.trimmingCharacters(in: CharacterSet(charactersIn: "/"))
                 comment = "    <!-- \(commentForAndroid) -->"
             case .iOS:
                 comment = key

                case .Android:
                    let keyForAndroid = String(key.characters.map {
                        $0 == " " ? "_" : $0
                        }).lowercaseString
                    
                    var valueForAndroid = line[i]
                        .stringByReplacingOccurrencesOfString("&", withString: "&amp;")
                        .stringByReplacingOccurrencesOfString("'", withString: "\\'")
                    
                    var i = 1
                    let placeholderForIOS = "%@"
                    while valueForAndroid.containsString(placeholderForIOS) {
                        valueForAndroid = valueForAndroid
                            .stringByReplacingOccurrencesOfString(placeholderForIOS, withString: "%\(i)$s", range: valueForAndroid.rangeOfString(placeholderForIOS))
                        i += 1
                    }
                    
                    localization = "    <string name=\"\(keyForAndroid)\">\(valueForAndroid)</string>"
                case .iOS:
                    let escaped = line[i].stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
                    localization = "\"\(key)\" = \"\(escaped)\";"
                }
                langs[langIndex].append(localization)


if platform == .Android {
    for i in 0..<langs.count {
        langs[i].insert("</resources>", at:langs[i].count)
    }
}

//Save results
if let dirPath = path.deletingLastPathComponent?.appendingPathComponent("Result_\(platform)") {
    try! FileManager.default.createDirectory(at: dirPath, withIntermediateDirectories: true, attributes: nil)
    for i in 0..<firstRow.count {
        let dirName: String
        switch platform {
