package main
import (
"fmt"
"regexp"
"strings"
)
func main() {
s := "golang c# rust java c c++ java java python"
toremove := "java"
s = strings.ReplaceAll(s, toremove, "")
whitespaceregx := regexp.MustCompile(`\s+`)
s = whitespaceregx.ReplaceAllString(s, " ")
fmt.Println(s)
}
/*
run:
golang c# rust c c++ python
*/