I am using the Split method to retrieve the words from two separate strings (str1 , str2) and append all together in another Array (str)
package main
import (
"fmt"
"strings" )
func main() {
Name := "Red Blue Green"
Address := "New York Paris France"
str1 := strings.Split(Name, " ")
str2 := strings.Split(Address, " ")
str := append(str1 , str2)
fmt.Println(str)
}
I am getting the error :
cannot use str2 (type []string) as type string in append
Go Playground Link :
https://play.golang.org/p/LxO50fzuYnh
Can anyone help me with this? I am a beginner at this.
Thank You.