package main
import (
"fmt"
"bytes"
)
func main() {
data := []byte("1,2\n3,4\n5,6\n7,89")
lines := bytes.Split(data, []byte{10})
line := bytes.Split(lines[0], []byte(","))
fmt.Println(data)
fmt.Println(lines)
fmt.Println(line)
}
结果
[49 44 50 10 51 44 52 10 53 44 54 10 55 44 56 57]
[[49 44 50] [51 44 52] [53 44 54] [55 44 56 57]]
[[49] [50]]