 extension String {
 
     var isEmptyOrWhitespace: Bool {
-        return isEmpty ? true : stringByTrimmingCharactersInSet(.whitespaceCharacterSet()) == ""
+        return characters.isEmpty ? true : trimmingCharacters(in: .whitespaces()) == ""
     }
 
     var isNotEmptyOrWhitespace: Bool {

        return merged
    }

}
        keyedRows = rows.map { field -> [String: String] in
            var row = [String: String]()
            //only store value which are not empty
            for (index, value) in field.enumerated() where value.isNotEmptyOrWhitespace {
                row[tempHeaders[index]] = value
            }
            return row
