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

    public let rows: [[String]]

    public init(string: String, separator: String = ",", headers: [String]? = nil) {
        var parsedLines = CSwiftV.recordsFromString(string.stringByReplacingOccurrencesOfString("\r\n", withString: "\n")).map { CSwiftV.cellsFromString($0, separator: separator) }
        self.headers = headers ?? parsedLines.removeFirst()
        rows = parsedLines
        columnCount = self.headers.count

    }

    internal static func cellsFromString(rowString: String, separator: String = ",") -> [String] {
        return CSwiftV.split(separator: separator, string: rowString).map { element in
            if let first = element.characters.first, let last = element.characters.last where first == "\"" && last == "\"" {
                let result = String(element.characters.dropFirst().dropLast())
                return result
            }
            return element
        }
    }

    internal static func recordsFromString(string: String) -> [String] {
        return  CSwiftV.split(separator: "\n", string: string).filter { ($0 as String).isNotEmptyOrWhitespace }
    }

    private static func split(separator: String, string: String) -> [String] {

        func oddNumberOfQuotes(string: String) -> Bool {
            return string.components(separatedBy: "\"").count % 2 == 0
        }

        let initial = string.components(separatedBy: separator)
        var merged = [String]()
        for newString in initial {
            guard let record = merged.last where oddNumberOfQuotes(string: record) == true else {
                merged.append(newString)
                continue
            }
