julia icon indicating copy to clipboard operation
julia copied to clipboard

Add usage details for Base.eachsplit

Open logankilpatrick opened this issue 3 years ago • 0 comments

I am reading through the docs for [Base.eachsplit](https://docs.julialang.org/en/v1/base/strings/#Base.eachsplit) and right now its use case is not clear to me. I see that the type it returns is different than split, but the current example does not make it clear why I would want to use it instead of just split:

julia> split(a, ".")
2-element Vector{SubString{String}}:
 "Ma"
 "rch"

julia> collect(eachsplit(a, "."))
2-element Vector{SubString}:
 "Ma"
 "rch"

logankilpatrick avatar Sep 14 '22 03:09 logankilpatrick