Mega Code Archive

 
Categories / Python / String
 

String replacement

S = 'spammy' S = S.replace('mm', 'xx') print S print 'aa$bb$cc$dd'.replace('$', 'SPAM')