package main import ( "fmt" "strings" ) func main() { str := "welcome to sharejs.com" str = strings.Replace(str, " ", ",", -1) fmt.Println(str) }