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 everything after .zip? I've tried rsplit
and split
, but neither included the .zip when deleting extra characters.
Any suggestions?