Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strings.TrimRight remove one more letter. #12771

Closed
rockneurotiko opened this issue Sep 28, 2015 · 2 comments
Closed

strings.TrimRight remove one more letter. #12771

rockneurotiko opened this issue Sep 28, 2015 · 2 comments

Comments

@rockneurotiko
Copy link

I don't know if this is the expected result, but I hope it isn't:

a := strings.TrimRight("1234t.html", ".html")
fmt.Println(a) // Expected 1234t, get 1234

Playground

Edit (Information about my machine according to the guidelines)
Version: 1.5.1
OS: ArchLinux x86_64
The other things are already answered 😄

@cespare
Copy link
Contributor

cespare commented Sep 28, 2015

Please re-read the docs for TrimRight.

You want TrimSuffix: http://play.golang.org/p/gVdhgTSMoL

@adg adg closed this as completed Sep 28, 2015
@rockneurotiko
Copy link
Author

Thanks.. my bad u.U

@golang golang locked and limited conversation to collaborators Sep 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants