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