code: def num_forward_until(self, condition):
          
          i, c = 0, ''
          while self.hasNext() and not condition(self.peek()):
              c += self.forward(1)
              i += 1
          assert self.backward(i) == c
          return i
docs: Forward until one of the provided matches is found.
  
          :param condition: set of valid strings