📅  最后修改于: 2022-03-11 14:45:01.877000             🧑  作者: Mango
str1 := []string{"the","cat","in","the","hat"}
fmt.Println(str1)
str2 := strings.Join(str1, " ")
fmt.Println(str2)
str3 := strings.Join(str1, ", ")
fmt.Println(str3)
Output:
[the cat in the hat]
the cat in the hat
the, cat, in, the, hat