| 1 | class StringManipulator: |
| 2 | def __init__(self, string): |
| 3 | self.string = string |
| 4 | |
| 5 | def concatenate(self, other_string): |
| 6 | return self.string + other_string |
| 7 | |
| 8 | def length(self): |
| 9 | return len(self.string) |
| 10 | |
| 11 | def slice(self, start, end): |
| 12 | return self.string[start:end] |
| 13 | |
| 14 | def repeat(self, times): |
| 15 | return self.string * times |
| 16 | |
| 17 | def uppercase(self): |
| 18 | return self.string.upper() |
| 19 | |
| 20 | def lowercase(self): |
| 21 | return self.string.lower() |
| 22 | |
| 23 | def strip(self): |
| 24 | return self.string.strip() |
| 25 | |
| 26 | def split(self, separator): |
| 27 | return self.string.split(separator) |
| 28 | |
| 29 | def format(self, *args): |
| 30 | return self.string.format(*args) |
| 31 | |
| 32 | def interpolate(self, **kwargs): |
| 33 | return self.string.format(**kwargs) |