strings.Trim bug?

Hello, I’d like to know from you if the returned string from strings.Trim is what we expect:

package main

import (
“fmt”
“strings”
)

func main() {
fmt.Print(strings.Trim(“ciao.com”, “.com”))
}

It should return “ciao” or I miss something. If you run this code you see that return “ia”

Sorry, is not a bug :slight_smile: Moderator you can delete the topic. It’s better to use TrimSuffix in this case. The Trim delete all “c” and “o” and .“com” from the source. That’s why it return ia.

3 Likes