I want to search for a word in the text and then print the text without that word. For example, we have the text "I was with my friend", I want the text be "I with my friend". I have done the following so far:
text=re.compile("[^was]")
val = "I was with my friend"
if text.search(val):
print text.search(val) #in this line it is obvious wrong
else:
print 'no'
val = "I was with my friend"
print val.replace("was ", "")
Output:
I with my friend
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With