我想用分隔符分割一个字符串,结果应该是一个片段。

For example:

给定的字符串可能如下所示:

 foo := "foo=1&bar=2&&a=8"

结果应该是这样的

 result := []string{
    "foo=1",
    "bar=2&",
    "a=8"
}
strings.split(foo, "&")
 // the result with strings.split()
 result := []string{
    "foo=1",
    "bar=2",
    "",
    "a=8"
}