remove everything after substring python code example
Example 1: remove substring python
>>> papa = 'papa is a good man'
>>> papa.replace('papa', '')
' is a good man'
Example 2: python remove everything after character
sep = '...'
stripped = text.split(sep, 1)[0]