Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[String] add $lastGlue argument to join() methods#33914
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ro0NL commentedOct 8, 2019
unicode defines a start/middle/end part:https://github.com/unicode-org/icu/blob/fd123bf023882f07bfacf51c39111be2f946d8f8/icu4c/source/data/locales/en.txt#L2008-L2019 this was on my list to investigate :) not sure it fits String component, as i was already skeptical about ultimately i want to format list values in ICU translation files, but the spec format is missing still :(https://github.com/tc39/proposal-intl-list-format |
nicolas-grekas commentedOct 8, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ro0NL I'm not trying to solve 100% of the problem but the most common that we've all been solving again and again. TC39 is another level of complexity (same reasoning about |
ro0NL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
anyway, i think this feature is fine for non-localized stuff either way 👍
gharlan commentedOct 9, 2019
What do you think about making the method static, like in Java:https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#join-java.lang.CharSequence-java.lang.CharSequence...- For me, it is a kind of named special constructor for a string (and not a method for doing something with the glue string). |
nicolas-grekas commentedOct 9, 2019
I think it would make the method harder to discover. |
stof commentedOct 11, 2019
I'm not even sure this should belong to a String component, as it is more about dealing with arrays... |
nicolas-grekas commentedOct 11, 2019
@stof Python has it. That's a serious enough precedent to me. |
…as-grekas)This PR was merged into the 5.0-dev branch.Discussion----------[String] add $lastGlue argument to join() methods| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -An idea that came when reviewingsymfony/symfony-docs#12440Commits-------714d629 [String] add $lastGlue argument to join() methods
An idea that came when reviewingsymfony/symfony-docs#12440