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

Contents of /src/packages/mstring.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1.2.2 - (hide annotations) (download) (as text) (vendor branch)
Tue Oct 4 17:04:05 2005 UTC (8 years, 6 months ago) by marduk
Branch: pre_2-0
Changes since 1.1.1.1.2.1: +11 -0 lines
File MIME type: text/x-python
Refactoring.

1 marduk 1.1.1.1.2.2 #
2     # Copyright (C) 2003-2005, marduk <marduk@python.net>
3     #
4     # This copyrighted material is made available to anyone wishing to use,
5     # modify, copy, or redistribute it subject to the terms and conditions
6     # of the GNU General Public License v.2.
7     #
8     # You should have received a copy of the GNU General Public License
9     # along with this program; if not, write to the Free Software Foundation,
10     # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
11     #
12 marduk 1.1 """marduk's helpin' heap 'o string functions"""
13    
14    
15 marduk 1.1.1.1.2.1 def replace_sub(string, new, start, end=None):
16     """Replacing substring of s with new, return new string, and position
17     directly after substitution
18     """
19     if end is None:
20     end = start
21     string2 = string[:start] + new + string[end + 1:]
22     newpos = start + len(new)
23    
24     return (string2, newpos)

  ViewVC Help
Powered by ViewVC 1.1.20