Skip to content

Commit

Permalink
break on first match instead of return
Browse files Browse the repository at this point in the history
  • Loading branch information
shayan-yousefi committed Aug 9, 2024
1 parent 2135878 commit 63e4d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/str/str.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ func (s *String) ChopEnd(needle string, more ...string) *String {
for _, v := range more {
if s.EndsWith(v) {
s.value = strings.TrimRight(s.value, v)
return s
break
}
}
return s
Expand All @@ -897,7 +897,7 @@ func (s *String) ChopStart(needle string, more ...string) *String {
for _, v := range more {
if s.StartsWith(v) {
s.value = strings.TrimLeft(s.value, v)
return s
break
}
}
return s
Expand Down

0 comments on commit 63e4d80

Please sign in to comment.