Answers for "python delete words from string"

10

remove word from string python

#You can remove a word from a string using str.replace ()
myString = 'papa is a good man'
newString = myString.replace('papa', '')
>>>' is a good man'
Posted by: Guest on March-14-2020
1

Python Remove a character from a string

# Python program to remove single occurrences of a character from a string
text= 'ItsMyCoode'
print(text.replace('o','',1))
Posted by: Guest on December-08-2021

Code answers related to "python delete words from string"

Python Answers by Framework

Browse Popular Code Answers by Language