-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 |
@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 |
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 👍
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). |
I think it would make the method harder to discover. |
I'm not even sure this should belong to a String component, as it is more about dealing with arrays... |
@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 reviewing symfony/symfony-docs#12440 Commits ------- 714d629 [String] add $lastGlue argument to join() methods
An idea that came when reviewing symfony/symfony-docs#12440