diff --git a/Examples/MacOS/SampleMacSwift/Podfile b/Examples/MacOS/SampleMacSwift/Podfile index 9530c42..39f2875 100644 --- a/Examples/MacOS/SampleMacSwift/Podfile +++ b/Examples/MacOS/SampleMacSwift/Podfile @@ -7,7 +7,7 @@ target 'SampleMacSwift' do pod 'SwiftLoggly’ # pod 'SwiftCSVExport' - pod 'SwiftCSVExport', :git => 'https://github.com/vigneshuvi/SwiftCSVExport.git', :tag => '2.1.0' + pod 'SwiftCSVExport', :git => 'https://github.com/vigneshuvi/SwiftCSVExport.git', :tag => '2.3.0' # Pods for SampleMacSwift diff --git a/README.md b/README.md index d663257..1d9e94c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Supported swift 4, 4.2 and 5 and latest Xcode pod 'SwiftCSVExport' , '= 2.0.2' // Swift 4 pod 'SwiftCSVExport' , '= 2.0.3' // Swift 4.2 -pod 'SwiftCSVExport' , '= 2.2.0' // Swift 5 +pod 'SwiftCSVExport' , '= 2.3.0' // Swift 5 ``` diff --git a/Sources/CSVConstants.swift b/Sources/CSVConstants.swift index 2f4b033..adb99c6 100644 --- a/Sources/CSVConstants.swift +++ b/Sources/CSVConstants.swift @@ -105,10 +105,11 @@ extension String { func formatCSVRow(_ div:String, value:Any) -> String { if let string = value as? String { // Wrap around double quotes - let fString = "\(string)" - return self.length == 0 ? fString : "\(self)\(div)\(fString)" + let doubleQuotes = "'" + let fString = doubleQuotes+"\(string)"+doubleQuotes + return self.length == 0 ? fString : "\(self)\(div) \(string)" } else { - return self.length == 0 ? "\(value)" : "\(self)\(div)\(value)" + return self.length == 0 ? "\(value)" : "\(self)\(div) \(value)" } } diff --git a/SwiftCSVExport/Sources/CSVConstants.swift b/SwiftCSVExport/Sources/CSVConstants.swift index af55a26..c054fbd 100644 --- a/SwiftCSVExport/Sources/CSVConstants.swift +++ b/SwiftCSVExport/Sources/CSVConstants.swift @@ -105,10 +105,12 @@ extension String { func formatCSVRow(_ div:String, value:Any) -> String { if let string = value as? String { // Wrap around double quotes - let fString = "\(string)" - return self.length == 0 ? fString : "\(self)\(div)\(fString)" + let doubleQuotes = "'" + + let fString = doubleQuotes+"\(string)"+doubleQuotes + return self.length == 0 ? fString : "\(self)\(div) \(string)" } else { - return self.length == 0 ? "\(value)" : "\(self)\(div)\(value)" + return self.length == 0 ? "\(value)" : "\(self)\(div) \(value)" } }