/[gentoo]/src/packages/mstring.py
Gentoo

Diff of /src/packages/mstring.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1.1.1 Revision 1.1.1.1.2.1
1"""marduk's helpin' heap 'o string functions""" 1"""marduk's helpin' heap 'o string functions"""
2 2
3 3
4def replace_sub(s,new,start,end=None): 4def replace_sub(string, new, start, end=None):
5 """Replacing substring of s with new, return new string, and position
6 directly after substitution
7 """
5 if end is None: 8 if end is None:
6 end = start 9 end = start
7 s2 = s[:start] + new + s[end + 1:] 10 string2 = string[:start] + new + string[end + 1:]
8 newpos = start + len(new) 11 newpos = start + len(new)
9 12
10 return (s2,newpos) 13 return (string2, newpos)

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.20