Last active
December 4, 2018 20:27
-
-
Save alsedi/47e06de83e20695660fe3e1f58ac4cf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let content = "abc,cde,128,256\nefg,ghi,42" //string with CSV file content | |
// parsing | |
let parsedCSV: [[String]] = content.components(separatedBy: "\n").map{ $0.components(separatedBy: ",") } | |
print(parsedCSV) | |
// ["abc","cde","128","256"],["efg","ghi","42"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment