use tr instead of gsub when possible
Merge pull request #17125 from acrogenesis/master

use tr instead of gsub when possible