The Join() Function is used to join all the elements of an array into one string.
package main import "fmt" import "strings" func main() { x := []string{"Hello", "Beautiful", "World"} y := strings.Join(x, "@") fmt.Println(y) }
In the above code, we have declared an array with values 'Hello', 'Beautiful' and 'World'.And assigned it to a variable 'x'.
Then we have used the 'Join()' function to take all the three values from the array and join them, separated using '@'.