Input string: "///hello//stackover.flow"
Expected output: "/hello/stackover.flow"
Input string: "///hello//stackover.flow"
Expected output: "/hello/stackover.flow"
Just an option. You can use it if you need to replace some other multiple characters.
re, _ := regexp.Compile("/+")
fmt.Println(re.ReplaceAllLiteralString("///hello//stackover.flow", "/"))