text = 'Mohammad_Sadegh_Eslahi' text = text.replace('_', ' ') print(text) >>> 'Mohammad Sadegh Eslahi'