Skip to content
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

String helper split doesn't split by empty string. #414

Open
mbehzad opened this issue Oct 31, 2022 · 0 comments
Open

String helper split doesn't split by empty string. #414

mbehzad opened this issue Oct 31, 2022 · 0 comments

Comments

@mbehzad
Copy link

mbehzad commented Oct 31, 2022

Hi,
split helper will ignore the empty string ("") as the separator and fall back to comma (,) which is a different behavior compared to the JS's String.prototype.split method. e.g.:
{{split "text" ""}} -> ["text"] but "text".split("") -> ["t", "e", "x", "t"]

The issue with util.isString and it returning false for the empty string was previously discussed in issue #273 . but i think for this helper it makes sense to have different logic.

I can provide a PR if you are open to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant