mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
added rpartition method to UserString class
This commit is contained in:
parent
e001816dff
commit
a26de2a80f
1 changed files with 4 additions and 1 deletions
|
@ -102,7 +102,8 @@ class UserString:
|
||||||
return self.__class__(self.data.ljust(width, *args))
|
return self.__class__(self.data.ljust(width, *args))
|
||||||
def lower(self): return self.__class__(self.data.lower())
|
def lower(self): return self.__class__(self.data.lower())
|
||||||
def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars))
|
def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars))
|
||||||
def partition(self, sep): return self.data.partition(sep)
|
def partition(self, sep):
|
||||||
|
return self.data.partition(sep)
|
||||||
def replace(self, old, new, maxsplit=-1):
|
def replace(self, old, new, maxsplit=-1):
|
||||||
return self.__class__(self.data.replace(old, new, maxsplit))
|
return self.__class__(self.data.replace(old, new, maxsplit))
|
||||||
def rfind(self, sub, start=0, end=sys.maxint):
|
def rfind(self, sub, start=0, end=sys.maxint):
|
||||||
|
@ -111,6 +112,8 @@ class UserString:
|
||||||
return self.data.rindex(sub, start, end)
|
return self.data.rindex(sub, start, end)
|
||||||
def rjust(self, width, *args):
|
def rjust(self, width, *args):
|
||||||
return self.__class__(self.data.rjust(width, *args))
|
return self.__class__(self.data.rjust(width, *args))
|
||||||
|
def rpartition(self, sep):
|
||||||
|
return self.data.rpartition(sep)
|
||||||
def rstrip(self, chars=None): return self.__class__(self.data.rstrip(chars))
|
def rstrip(self, chars=None): return self.__class__(self.data.rstrip(chars))
|
||||||
def split(self, sep=None, maxsplit=-1):
|
def split(self, sep=None, maxsplit=-1):
|
||||||
return self.data.split(sep, maxsplit)
|
return self.data.split(sep, maxsplit)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue