[PATCH OLK-6.6] perf util: Add a function for replacing characters in a string