def test_string ( self , string : str ) -> bool : if self . input . startswith ( string , self . offset ) : self . offset += len ( string ) return True return False
python check for next character in a string
If string comes next return True and advance offset .
def test_string(self, string: str) -> bool:
        """If `string` comes next, return ``True`` and advance offset.

        Args:
            string: string to test
        """
        if self.input.startswith(string, self.offset):
            self.offset += len(string)
            return True
        return False