Consider the following code
x = "123\n" y = chomp(x) display(SubString(y, 1, 10)) # "123\n"
We see that means that we allow
SubString to grow beyond its end.
Is it a planned feature?
I would expect that it should not be allowed. To fix this the following line https://github.com/JuliaLang/julia/blob/master/base/strings/types.jl#L30 should be replaced by:
SubString(s::SubString, i::Int, j::Int) = SubString(s.string, s.offset+i, s.offset+min(endof(s), j))