Swift 编写的标准 CSV 解析器。
let table = SwiftCSV(string: "Name,Age\nJohn,50\nJane,48") // failable
table.headers = ["Name", "Age"]
table.rows = [
["John", "50"],
["Jane", "48"]
]
table.dictionary = [
["Name" : "John", "Age" : "50"],
["Name" : "Jane", "Age" : "48"]
]
// See the function definition for more options on initialisation.
init
方法支持传递自定义分隔符和预定义的标题,如果未提供,则默认使用逗号和第一行。
提交一个问题