Tuesday, August 3, 2010

Python - replace character in a string

To replace a character("a") in a string with the other one ("b"):

s = s.replace('a', 'b')

No comments:

Post a Comment