Mega Code Archive
Categories
/
Python
/
String
Replace all
S = 'xxxxSPAMxxxxSPAMxxxx' print S.replace('SPAM', 'EGGS') # replace all