Join
Returns a string by concatenating all of the elements in the collection, separated by the specified separator string.
- Use
reflect.ValueOf()to get the array or slice and the separator string,make()to create an appropriate string slice. - Use a
forloop withValue.Len()andValue.Index()to iterate over each element,fmt.Sprintf()to convert it to a string. - Use
strings.Join()to combine the strings using the separator provided.