How would I delete everything after a certain character of a string in python? For example I have a string containing a file path and some extra characters. How would I delete e
You can use the re module:
re
import re re.sub('\.zip.*','.zip','test.zip.blah')