-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: strings: missing mirror functions #46514
Comments
Can you point to some examples of where these would be used in existing code? Thanks. |
Note that if we add CutLast as in #46336 then this would probably serve the need. |
this would serve the needs for
I can explain my use case, but I have not combed through the examples corpus to see if this would fit nicely into some existing logic, and this seems quite string parse(r/ing) specific. for |
These seem rare enough to have in other libraries to start. |
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. |
No change in consensus, so declined. |
background
there does not appear to be a turnkey way to do a SplitN of a string starting at the tail and proceeding toward the head. similarly, the following do not appear to exist:
SplitAfter
, but before (put the separator on the next element:[]string{"f" ",o" ",o"}
)SplitAfterN
, but beforeReplace
but start from the tailproposal
add the following symbols to the
strings
package:alternatives
we could say that these are weird and esoteric enough to not justify symbols for, but at least that decision is documented. there are workarounds to get this behaviour if you really need it:
I am very flexible on the names; so
LastSplitN
,ReplaceReverseN
, or anything else is fine; I am just interested in the functionality.The text was updated successfully, but these errors were encountered: