golang 一行代码 把array/slice转成逗号分隔的字符串

strings.Replace(strings.Trim(fmt.Sprint(array_or_slice), "[]"), " ", ",", -1)

  

[a] -> a -> a

[a b c] -> a b c -> a,b,c

posted @ 2020-09-02 17:40  golang-jack  阅读(2632)  评论(1编辑  收藏  举报