Skip to content

Commit

Permalink
fix #45
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySarnoff authored Aug 12, 2024
1 parent 0ad5018 commit 989fdb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/strings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,11 @@ getparts(indices::NamedTuple, str::AbstractString) =
map(x -> getpart(x, str), indices)

function getpart(r::UnitRange, str)
if iszero(r.start)
n = length(str)
if iszero(r.start) || r.start > n
"0"
elseif r.stop > n
str[r.start:n]
else
str[r]
end
Expand Down

0 comments on commit 989fdb4

Please sign in to comment.