How do I deal with commas when writing Objects to CSV in Swift?
问题 There seem to be other answers the this on stack overflow but nothing that is specific to swift. I am generating a CSV from an Site Object containing 3 properties Struct SiteDetails { var siteName:String? var siteType: String? var siteUrl: String? } The problem is that siteName may contain a comma so its making it really hard to convert back from CSV into a object when I read the CSV file back as some lines have 4 or more CSV elements. Here is the code I am using to export to CSV: func