array of string golang
var x [2]string // An array of 2 strings
x[1] = "German"
var y [2]string{"English", "Japanese"}
import "fmt"
for i := 0; i < len(y); i++ {
fmt.Println(y[i])
}
array of string golang
var x [2]string // An array of 2 strings
x[1] = "German"
var y [2]string{"English", "Japanese"}
import "fmt"
for i := 0; i < len(y); i++ {
fmt.Println(y[i])
}
string array to string golang
str1 := []string{"the","cat","in","the","hat"}
fmt.Println(str1)
str2 := strings.Join(str1, " ")
fmt.Println(str2)
str3 := strings.Join(str1, ", ")
fmt.Println(str3)
Output:
[the cat in the hat]
the cat in the hat
the, cat, in, the, hat
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us