We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5dd684 commit e7c56feCopy full SHA for e7c56fe
src/strings/strings.go
@@ -962,7 +962,8 @@ func TrimSpace(s string) string {
962
for ; stop > start; stop-- {
963
c := s[stop-1]
964
if c >= utf8.RuneSelf {
965
- return TrimFunc(s[start:stop], unicode.IsSpace)
+ // start has been already trimmed above, should trim end only
966
+ return TrimRightFunc(s[start:stop], unicode.IsSpace)
967
}
968
if asciiSpace[c] == 0 {
969
break
0 commit comments