You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func Join(a []string, sep string) string {
switch len(a) {
case 0:
return ""
case 1:
return a[0]
case 2:
// Special case for common small values.
// Remove if golang.org/issue/6714 is fixed
return a[0] + sep + a[1]
case 3:
// Special case for common small values.
// Remove if golang.org/issue/6714 is fixed
return a[0] + sep + a[1] + sep + a[2]
}
...
$ go version
go version go1.10 windows/amd64
该版本也没有引入 bytes 包. 但直接使用了 += 连接符
The text was updated successfully, but these errors were encountered:
关于join函数的说明, 可能需要修改
目前查看标准库实现方式是使用了 += 字符串连接操作的.
该版本也没有引入 bytes 包. 但直接使用了 += 连接符
The text was updated successfully, but these errors were encountered: