tur/csv-string
stdlib/csv-string.tur
owned String siblings for the tur/csv emitters.
Since: v2 (string-adoption-stdlib-plan, batch 3)
defn
csv/emit-row-with-delim-string
(csv/emit-row-with-delim-string [v : int delim : int] :)
serialize one row vec with a custom
Parameters
| v | a row vec (as from csv/parse) | |
| delim | field separator byte (e.g. 44 = ',') |
Returns
An owned String of the delimiter-separated row (no trailing newline), or an empty String if delim is invalid.
Example
(string/to-cstr (csv/emit-row-with-delim-string my-row 59)) ; => "a;b"
Since: v2
defn
csv/emit-row-string
(csv/emit-row-string [v : int] :)
serialize one row vec (comma-delimited), as an owned
Parameters
| v | a row vec (as from csv/parse) |
Returns
An owned String of the comma-separated row.
Example
(string/to-cstr (csv/emit-row-string my-row)) ; => "a,b"
Since: v2
defn
csv/emit-with-delim-string
(csv/emit-with-delim-string [rows : int delim : int] :)
serialize a cons list of row vecs with a
Parameters
| rows | cons list of row vecs (as from csv/parse) | |
| delim | field separator byte (e.g. 44 = ',') |
Returns
An owned String of the newline-separated document, or an empty String if delim is invalid.
Example
(string/to-cstr (csv/emit-with-delim-string my-rows 59)) ; => "a;b\n1;2\n"
Since: v2
defn
csv/emit-string
(csv/emit-string [rows : int] :)
serialize a cons list of row vecs (comma-delimited) to a
Parameters
| rows | cons list of row vecs (as from csv/parse) |
Returns
An owned String of the newline-separated CSV document.
Example
(string/to-cstr (csv/emit-string my-rows)) ; => "a,b\n1,2\n"
Since: v2