Answers for "python replace character in string with another character"

17

python replace letters in string

my_text = 'Aello world'
my_text = my_text.replace(my_text[0], 'H')
print (my_text)
Posted by: Guest on February-01-2021
0

python replace character in string

text = 'Mohammad_Sadegh_Eslahi'
text = text.replace('_', ' ')
print(text)
>>>
'Mohammad Sadegh Eslahi'
Posted by: Guest on December-24-2021

Code answers related to "python replace character in string with another character"

Python Answers by Framework

Browse Popular Code Answers by Language