I'm surprised it's doing this. What's the reasoning?
just a spce works as I expect:
" ".split(whereSeparator: \.isNewline) // [" "]
I'm surprised it's doing this. What's the reasoning?
just a spce works as I expect:
" ".split(whereSeparator: \.isNewline) // [" "]
Try adding omittingEmptySubsequences: false
to the call, see docs. There are two widely used conventions for how splitting should treat empty tokens, and this is the function parameter to control which way you want it to be. It's true
by default.
Wonder why auto complete do not show this version of split
:
but I can type it out and use it just fine...
Autocomplete doesn't show all variations of functions with defaulted parameters. It really should, with a better UI to choose the variant and parameters you want, but right now it doesn't.
I hope autocomplete can be improved to show all choices.
It should also show any choices available from more specific conditional conformance
this would great help with api discovery and learning.