String replacement : String Replace « String « Python






String replacement

String replacement

S = 'spammy'
S = S.replace('mm', 'xx')
print S


print 'aa$bb$cc$dd'.replace('$', 'SPAM')


           
       








Related examples in the same category

1.Replace allReplace all
2.Replace oneReplace one
3.String replace DemoString replace Demo
4.String method: With a minor replacementString method: With a minor replacement