2026/4/18小於 1 分鐘
解析
語法
parse(document: string): object[]參數
| 參數名稱 | 類型 | 說明 |
|---|---|---|
document | string | 要解析的 CSV 字串 |
回傳值
解析後的物件陣列,每個物件代表 CSV 中的一行,屬性名稱對應 CSV 的標題行。
const csvString = `Name,ID,Description
Stone,stone,A common block
Dirt,dirt,Another common block`;
const result = CsvIO.parse(csvString);
console.log(result);