blob: 59d5d7f361914c10c42aafff1f47639f52c66eac (
plain)
1
2
3
4
5
6
7
8
9
10
|
"""marduk's helpin' heap 'o string functions"""
def replace_sub(s,new,start,end=None):
if end is None:
end = start
s2 = s[:start] + new + s[end + 1:]
newpos = start + len(new)
return (s2,newpos)
|