How to replace the charactors in the string?

You should comment out print “$string\n”; unless you want IO to be part of your benchmark.