Your problem here is that replace! isn’t defined for strings because strings are immutable.
This is also true for other immutable collections. For example, replace!([1,2,3], 1=>2) works, but replace!(1:3, 1=>2) does not.
Your problem here is that replace! isn’t defined for strings because strings are immutable.
This is also true for other immutable collections. For example, replace!([1,2,3], 1=>2) works, but replace!(1:3, 1=>2) does not.