Yeah, I'm not convinced this is something we want to encourage. On Mon, Oct 6, 2014 at 12:07 PM, John Myles White <[email protected]> wrote:
> Indexing into strings is a either a slow or a dangerous way to live one's > life. > > -- John > > On Oct 6, 2014, at 9:05 AM, Daniel Høegh <[email protected]> wrote: > > > Would it not make sense to define replace for Int's and ranges like this? > > replace(s::String, index::Int, r) = string(s[1:index-1]) * string(r) * > string(s[index+1:end]) > > replace(s::String, range::UnitRange{Int}, r) = > string(s[1:first(range)-1]) * string(r) * string(s[last(range)+1:end]) > >
