def METHOD_NAME(self, string: str) -> bool:
    strlen = len(string)
    if self.buffer[self.index : self.index + strlen] == string:
        self.previous = self.index
        self.index += strlen
        return True
    return False