I need to replace \
with /
in a path string, but following code failed.
package main
import (
"fmt"
"strings"
)
func main() {
string := "P:\Project\project-name/content/topic/"
fmt.Println(strings.Replace(string, "\\", "/", -1))
}
Any helpful suggestions?