SplitN slices s into substrings separated by sep and returns a slice of the substrings between those separators.
package main import ( "fmt" "strings" ) func main() { fmt.Printf("%q\n", strings.SplitN("a,b,c", ",", 2)) z := strings.SplitN("a,b,c", ",", 0) fmt.Printf("%q (nil = %v)\n", z, z == nil) }