strings.Trim does not show the last character

Hey,

I am using the strings.Trim to show only the relevant information but it doesn’t show the last character.


FilePath := strings.Trim(filepath, "C:://users//123//") 
The output will be : File_123.tx (it's missing the last "t") ```

so is there a way that I can get the full name?

Do you want to have file path.Base? https://golang.org/pkg/path/filepath/#Base

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.