How to replace the charactors in the string?

julia> function g(s, tar, rep)
           @assert length(tar) == length(rep)
           replace(collect(s), Dict(zip(tar,rep))...) |> join
       end
g (generic function with 1 method)

julia> g("The cat sat on the mat", "ao", "oL")
"The cot sot Ln the mot"
2 Likes