A) I compile the following locally with my 8g version release.r59 9022 and it works. Output: [A,B,C]
package main
import "fmt"
import "strings"
func main() {
var x = "A|B|C"
fmt.Println(strings.Split(x, "|"))
}
B) When I compile & run the same code on the Go Playground it says: "not enough arguments in call to strings.Split.
C) I get the same error when using strings.Split that way in Google App 'Engine and compile it with dev_appserver.py ...
It works in variant B) and C) when modifying above code into strings.Split(x, "|" , 1). But then it doesn't work in variant A, where I get the error "too many arguments in call to strings.Split.
The package description says:
func Split(s, sep string) []string
BR