mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
258 B
15 lines
258 B
5 years ago
|
package solutions
|
||
|
|
||
|
//Join the elements of the slice using the sep as glue between each element
|
||
|
func Join(arstr []string, sep string) string {
|
||
|
res := ""
|
||
|
n := len(arstr)
|
||
|
for i, a := range arstr {
|
||
|
res += a
|
||
|
if i < n-1 {
|
||
|
res += sep
|
||
|
}
|
||
|
}
|
||
|
return res
|
||
|
}
|