Skip to content

Split string by string#43

Merged
marcprux merged 1 commit intoskiptools:mainfrom
dfabulich:split-by-string
Apr 18, 2026
Merged

Split string by string#43
marcprux merged 1 commit intoskiptools:mainfrom
dfabulich:split-by-string

Conversation

@dfabulich
Copy link
Copy Markdown
Contributor

This PR may be a bit surprising, because it removes func split(separator: Character) and adds in func split(separator: String). To my surprise, even when I left both overloads in, the existing character-based tests were all just using the string version once I added it.

Since the character-based implementation was, as far as I could tell, dead code, I eliminated it.

The implementation tries to use Kotlin split() if we're not omittingEmptySequences, but omittingEmptySequences defaults to true, so a simple "a,b,c".split(separator: ",") will not use Kotlin split().

(I also had to implement a whole separate code path for when the separator is empty, to match Swift's behavior in that case.)

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Cursor generated a first draft (especially the tests), and I rewrote its output.

@cla-bot cla-bot Bot added the cla-signed label Apr 17, 2026
@marcprux marcprux merged commit 75c6893 into skiptools:main Apr 18, 2026
4 of 5 checks passed
marcprux added a commit to skiptools/skip-fuse-ui that referenced this pull request Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants