1, take int Slice to a semicolon separated string
package main import( "fmt" "strings" ) func main() { slice := []int{1, 2, 3,
4, 5, 6, 7, 8, 9} str := strings.Replace(strings.Trim(fmt.Sprint(slice), "[]"),
" ", ";", -1) fmt.Println("string:", str) }
output :
1;2;3;4;5;6;7;8;9
 

2, take string Slice to a semicolon separated string
package main import( "fmt" "strings" ) func main() { slice :=
[]string{"peer0.org1.example.com","peer1.org1.example.com"} str :=
strings.Replace(strings.Trim(fmt.Sprint(slice), "[]"), " ", ";", -1)
fmt.Println("string:", str) }
output :
peer0.org1.example.com;peer1.org1.example.com
 

Technology
©2019-2020 Toolsou All rights reserved,
JS How to operate java Realize the function of grabbing red packets C Language programming to find a student's grade The United Nations 《 Glory of Kings 》 Please go to the studio : To save the earth Dialogue between apple and Nissan suspended ,Apple Car How's it going ?CSS architecture design China's longest high speed rail officially opened ! The fastest way to finish the race 30.5 hour First knowledge MySQL Comprehensive review ( dried food )2021 year 1 Monthly programmer salary statistics , average 14915 element How to use it quickly html and css Write static page