Answers for "python string remove string"

3

remove substring from string python

s = "Earthworms and Python are disgusting!"
s.replace('and Python ', '')
print(s)
#Run the code
result = "Earthworms are disgusting!"
Posted by: Guest on July-31-2021
0

remove a part of a string python

import re
url = 'abcdc.com'
url = re.sub('\.com$', '', url)
Posted by: Guest on July-20-2020

Code answers related to "python string remove string"

Python Answers by Framework

Browse Popular Code Answers by Language