关于go:如何在Golang中为字符串添加单引号

26次阅读

共计 149 个字符,预计需要花费 1 分钟才能阅读完成。

我在 Go 中有一个字符串切片,我想将其示意为逗号分隔的字符串。这是切片

example := []string{"apple", "Bear", "kitty"}

如何输入字符串 'apple', 'Bear', 'kitty'

commaSep := "'"+ strings.Join(example,"', '") +"'"

正文完
 0