Skip to content

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

Description

@mbehzad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions