-
-
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
split() enhancement, keep_splitter #20625
Comments
Note that another way of looking at the current |
This also crops up when trying to split camel case strings: foo = "ThisShouldBeSeparate"
split(foo, isuppercase)
5-element Array{SubString{String},1}:
""
"his"
"hould"
"e"
"eparate" A solution is to use a regex delimiter: |
I think this should be called |
@StefanKarpinski, I posted a topic yesterday and planned to create a new ticket, but this one can be merged too. I posted a message yesterday here then erased it (because it was not exactly the same goal), so perhaps that is why it bumped again! In my case, it was to have it as a separate element, as in other languages shown there, but I think we can make this |
I think |
Hello,
I would like to suggest a feature request, which I'm now working on in a new branch, for the
split(str, splitter; limit=0, keep=true)
function.I found myself trying to use the function in that way, and what I expect somehow is the following,
Should I keep on working? Would it be a breaking change for the rest of the ecosystem?
Some ideas:
keep_spliter
flag istrue
, then it should not make any difference whetherkeep
(which stands for empty results), istrue
orfalse
, since, there wouldn't be empty results at all.readlines(file)
work, isn't it? In each element of the array we have'\n'
at the end.Thanks in advance!
PS, maybe it can be done with another function I don't know yet
The text was updated successfully, but these errors were encountered: