Probably a silly thing but got stuck on it for a bit...
Can't trim a "["
char from a string, things I tried with outputs:
package main
import (
"fmt"
"strings"
)
func main() {
s := "this[things]I would like to remove"
t := strings.Trim(s, "[")
fmt.Printf("%s
", t)
}
// output: this[things]I would like to remove
Also tried all of those, with no success:
s := "this [ things]I would like to remove"
t := strings.Trim(s, " [ ")
// output: this [ things]I would like to remove
s := "this [ things]I would like to remove"
t := strings.Trim(s, "[")
// output: this [ things]I would like to remove
None worked. What am I missing here?