golang strings.Trim(...) - for semicolons?
I'm new to go, and I'm trying to parse some file. Go has this convenient strings.Trim() function:
https://pkg.go.dev/strings#Trim
I seem to have an issue, when I try to strip semicolons (;):
On the site linked above, I changed the example code from:
fmt.Print(strings.Trim("¡¡¡Hello, Gophers!!!", "!¡"))
to:
fmt.Print(strings.Trim("¡¡¡Hello, Gophers;!!!;", ";"))
I'd expect it to remove all semicolons, yet it only removes the last one.
I also noted that the following string / cutset combination only removes the trailing exclamation mark:
fmt.Print(strings.Trim("¡¡¡Hello, Gophers;!;!!", "!"))
How should I use the Trim function, so I get rid of all semicolons?
Do I need to sanitize the input string?