Skip to content

Commit d498d36

Browse files
authored
Update eachsplit example, fixes #46751 (#47070)
1 parent f1b05c1 commit d498d36

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

base/strings/util.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,10 @@ See also [`split`](@ref).
500500
julia> a = "Ma.rch"
501501
"Ma.rch"
502502
503-
julia> collect(eachsplit(a, "."))
503+
julia> b = eachsplit(a, ".")
504+
Base.SplitIterator{String, String}("Ma.rch", ".", 0, true)
505+
506+
julia> collect(b)
504507
2-element Vector{SubString{String}}:
505508
"Ma"
506509
"rch"

0 commit comments

Comments
 (0)