[Tutor] replacing something on last line

Gregor Lingl glingl@aon.at
Sun, 7 Jul 2002 22:45:39 +0200


... or try to use this:

>>> s = """text
text 
text
text Special Special
"""
>>> last = s.rfind('Special')
>>> last
29
>>> print s[:last]+s[last:].replace('Special','General')
text
text 
text
text Special General

>>> 

Gregor