-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
A version of split that returns an array of substrings #3667
Comments
Modifying strings isn't really an issue since we don't support it. |
Could also fix #1250. For a string of type |
Of course, just realized that we changed String to immutable. In that case, this seems even more reasonable to do. SubString indexing can be improved upon, I am sure. |
Given the For example, we could then use it in |
Bump, as @simonster, noted, I believe this is fixed. |
I often find myself wanting an array of SubStrings rather than Strings as the output of
split
, in order to save memory and reduce GC pressure.It would prefer to return an array of SubStrings by default, but I believe SubString indexing is slow (
unsafe_view
can help for now), and also any modifications to the SubStrings will get reflected in the original String (which I think is ok).At the very least, I would propose to have
splitsub
.The text was updated successfully, but these errors were encountered: