Replace part of a string in Python?
>>> stuff = "Big and small"
>>> stuff.replace(" and ","/")
'Big/small'
Use the replace()
method on string:
>>> stuff = "Big and small"
>>> stuff.replace( " and ", "/" )
'Big/small'
>>> stuff = "Big and small"
>>> stuff.replace(" and ","/")
'Big/small'
Use the replace()
method on string:
>>> stuff = "Big and small"
>>> stuff.replace( " and ", "/" )
'Big/small'