strings.Join() Function in Golang With Examples Last Updated : 10 May, 2020 Comments Improve Suggest changes Like Article Like Report strings.Join() Function in Golang concatenates all the elements present in the slice of string into a single string. This function is available in the string package. Syntax: func Join(s []string, sep string) string Here, s is the string from which we can concatenate elements and sep is the separator which is placed between the elements in the final string. Return Value: It returns a string. Example 1: C // Golang program to illustrate the // use of strings.Join Function package main // importing fmt and strings import ( "fmt" "strings" ) // calling main method func main() { // array of strings. str := []string{"Geeks", "For", "Geeks"} // joining the string by separator fmt.Println(strings.Join(str, "-")) } Output: Geeks-For-Geeks Example 2: C // Golang program to illustrate the // use of strings.Join Function package main // importing fmt and strings import ( "fmt" "strings" ) // calling main method func main() { // array of strings. str := []string{"A", "Computer-science", "portal", "for", "Geeks"} // joining the string by separator in middle. fmt.Println(strings.Join(str, " ")) } Output: A Computer-science portal for Geeks Comment More infoAdvertise with us Next Article strings.Join() Function in Golang With Examples P PranchalKatiyar Follow Improve Article Tags : Go Language Golang-String Similar Reads strings.Index() Function in Golang With Examples strings.Index() Function in Golang is used to get the first instance of a specified substring. If the substring is not found, then this method will return -1. Syntax: func Index(str, sbstr string) int Here, str is the original string and sbstr is a string whose we want to find index value. Example 1 2 min read strings.SplitN() Function in Golang with Examples strings.SplitN() Function() is a string manipulation function in Go language. It is used to split a given string into substrings separated by a separator. This function returns the slices of all substrings between those separators. Syntax: func SplitN(s, sep string, n int) []string Here, s is the st 3 min read strings.Map() Function in Golang With Examples strings.Map() Function in Golang is used to return a copy of the string given string with all its characters modified according to the mapping function. If mapping returns a negative value, the character is dropped from the string with no replacement. So whenever the user wants to make changes in a 2 min read strings.IndexAny() Function in Golang With Examples strings.IndexAny() Function in Golang is used to returns the index of the first instance of any Unicode code point from chars in the original string. If the Unicode code point from chars is not available in the original string, then this method will return -1. Syntax: func IndexAny(str, charstr stri 2 min read strings.IndexByte() Function in Golang With Examples strings.IndexByte() Function in Golang returns the index of the first instance of the given byte in the original string. If the given byte is not available in the original string, then this method will return -1. Syntax: func IndexByte(str string, b byte) int Here, str is the original string and b i 1 min read Like