code: def iterlines(s):
      
      prevnl = -1
      while True:
          nextnl = s.find('\n', prevnl + 1)
          if nextnl < 0:
              yield s[(prevnl+1):]
              break
          else:
              yield s[(prevnl+1):nextnl]
              prevnl = nextnl
docs: A generator form of s.split('\n') for reducing memory overhead.
  
      Parameters
      ----------
      s : str
          A multi-line string.
  
      Yields
      ------
      line : str
          A string.