string remove from strpython code example
Example 1: remove substring python
>>> papa = 'papa is a good man'
>>> papa.replace('papa', '')
' is a good man'
Example 2: python remove string from string
s = 'ab12abc34ba'
print(s.replace('ab', ''))
>>> papa = 'papa is a good man'
>>> papa.replace('papa', '')
' is a good man'
s = 'ab12abc34ba'
print(s.replace('ab', ''))