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])

Reply via email to