//切片转为字符串
arr := []string{"", "ccc", "ccc", "view4"}
str := strings.Join(arr, "/")
fmt.Println(str)
//字符串转为切片
s := strings.Split("a,b,c,d", ",")
fmt.Println(s, len(s))
go字符串转切片和切片转字符串
于 2023-05-19 15:50:50 首次发布
//切片转为字符串
arr := []string{"", "ccc", "ccc", "view4"}
str := strings.Join(arr, "/")
fmt.Println(str)
//字符串转为切片
s := strings.Split("a,b,c,d", ",")
fmt.Println(s, len(s))