-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: bytes, strings: TrimStart
and TrimEnd
replacing TrimLeft
and TrimRight
#54678
Comments
TrimStart
and TrimEnd
replacing TrimLeft
and TrimRight
TrimStart
and TrimEnd
replacing TrimLeft
and TrimRight
Yes, I agree. It'd be similar to Rust, i.e.,
|
This seems like a lot of churn for not too much benefit. |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely decline. |
I agree that it still causes confusion between
|
No change in consensus, so declined. |
TrimLeft
andTrimRight
implicitly assumes a left-to-right writing system, but this is odd. Actually a string literal can include right-to-left languages and how to show them depends on editors. We don't have to (or cannot) determine visible directions of texts.So, what about adding new functions
TrimStart
andTrimEnd
as aliases toTrimLeft
andTrimRight
, and deprecatingTrimLeft
andTrimRight
? This naming is the same way as CSS (e.g.padding-inline-start
forpadding-left
)The replacing targets are:
bytes.TrimLeft
bytes.TrimLeftFunc
bytes.TrimRight
bytes.TrimRightFunc
strings.TrimLeft
strings.TrimLeftFunc
strings.TrimRight
strings.TrimRightFunc
The text was updated successfully, but these errors were encountered: