Skip to content

Commit

Permalink
add comment about accepted types for s
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored and StefanKarpinski committed Feb 3, 2018
1 parent 9de9198 commit 30ac0af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ end

thisind(s::String, i::Int) = _thisind_str(s, i)

# s should be String or SubString{String}
function _thisind_str(s, i::Int)
i == 0 && return 0
n = ncodeunits(s)
Expand All @@ -122,6 +123,7 @@ end

nextind(s::String, i::Int) = _nextind_str(s, i)

# s should be String or SubString{String}
function _nextind_str(s, i::Int)
i == 0 && return 1
n = ncodeunits(s)
Expand Down

0 comments on commit 30ac0af

Please sign in to comment.