您的位置 首页 golang

Golang标准包详解——string.Join

1、用法

func Join(a []string, sep string) string 

Join concatenates the elements of a to create a single string. The separator string sep is placed between elements in the resulting string.

Join 函数联结a的元素组成单个 字符串 。然后分隔符字符sep 被放置在生成的字符串元素中间。

2、示例

3、效果

root@node1:~/go_test# go run main2.go Hello DevOps24h!

Hello DevOps24h!

文章来源:智云一二三科技

文章标题:Golang标准包详解——string.Join

文章地址:https://www.zhihuclub.com/87681.shtml

关于作者: 智云科技

热门文章

网站地图