Skip to content

Improve stdlib stringSplit behavior for empty separator #4585

Description

@roman-khimov

Summary or problem description
stringSplit("abc", "") returns ["abc"].

Do you have any solution you want to propose?
Nothing specifically bad about that, but Go library returns ["a", "b", "c"] in this case and I find this behavior somewhat more useful (how to make a character level split otherwise?), so this can be an improvement.

Related to #4584, nspcc-dev/neo-go#4367.

Where in the software does this update applies to?

  • Native contracts

Metadata

Metadata

Assignees

Labels

DiscussionInitial issue state - proposed but not yet acceptedHardfork

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions