diff options
Diffstat (limited to 'scalarstring.py')
-rw-r--r-- | scalarstring.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scalarstring.py b/scalarstring.py index b02ad1d..6689911 100644 --- a/scalarstring.py +++ b/scalarstring.py @@ -21,6 +21,9 @@ class ScalarString(text_type): # type: (Any, Any) -> Any return text_type.__new__(cls, *args, **kw) # type: ignore + def replace(self, old, new, maxreplace=-1): + return type(self)((text_type.replace(self, old, new, maxreplace))) + class PreservedScalarString(ScalarString): __slots__ = () |