(self, needle: str, start: int = 0, end: Optional[int] = None)
| 787 | self.pos = 0 |
| 788 | |
| 789 | def find(self, needle: str, start: int = 0, end: Optional[int] = None) -> int: |
| 790 | assert start >= 0, start |
| 791 | pos = self.pos |
| 792 | start += pos |
| 793 | if end is None: |
| 794 | index = self.text.find(needle, start) |
| 795 | else: |
| 796 | end += pos |
| 797 | assert end >= start |
| 798 | index = self.text.find(needle, start, end) |
| 799 | if index != -1: |
| 800 | index -= pos |
| 801 | return index |
| 802 | |
| 803 | def consume(self, count: Optional[int] = None) -> str: |
| 804 | if count is None: |
no outgoing calls