(self, suffix, /)
| 1469 | return self.__class__(self.data.removeprefix(prefix)) |
| 1470 | |
| 1471 | def removesuffix(self, suffix, /): |
| 1472 | if isinstance(suffix, UserString): |
| 1473 | suffix = suffix.data |
| 1474 | return self.__class__(self.data.removesuffix(suffix)) |
| 1475 | |
| 1476 | def encode(self, encoding='utf-8', errors='strict'): |
| 1477 | encoding = 'utf-8' if encoding is None else encoding |