Use gsub intead of tr when the to_str is longer than the from_str
Merge pull request #9573 from robertomiranda/useless_gsub

Use gsub intead of tr when the to_str is longer than the from_str