Golang: Slice of Strings to String
Slice of Strings to String
strings.Join(slice, seperator)
-
Join a Slice of Strings to one big string.
package main import "fmt" import "strings" // join slice of strings to one big string func main() { var sls = []string{"abc", "xyz"} var result = strings.Join(sls, ",") fmt.Printf("%v\n", result) // abc,xyz }
Golang, array and slice
- Golang: Array
- Golang: Slice
- Golang: Slice of Slice
- Golang: Append to Slice
- Golang: Cut Slice (Delete Elements)
- Golang: Copy Slice
- Golang: Clear Slice
- Golang: Nested Slice
- Golang: Slice of Strings to String
- Golang: Iterate Slice
- Golang: Convert Value to String
- Golang: Convert Array to Slice
- Golang: Print Slice, Array