1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

encoding/csv: improve Reader docs (#6828)

This commit is contained in:
Nick Treleaven
2020-11-14 17:49:36 +00:00
committed by GitHub
parent 00464ad988
commit 01a5b263e5
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
## Reader example
```v
import encoding.csv
data := 'x,y\na,b,c\n'
mut parser := csv.new_reader(data)
// read each line
for {
items := parser.read() or {break}
println(items)
}
```
It prints:
```
['x', 'y']
['a', 'b', 'c']
```