code: public Text nextLine() {
          if (linePointer == 0) {
              linePointer = pos;
          } else {
              linePointer++;
          }
  
          int mark = linePointer;
          int limit = pos + len;
  
          while (linePointer < limit && chars[linePointer] != '\n') {
              linePointer++;
          }
          
          return new Text(chars, mark, linePointer - mark);
      }
docs: Extracts next line from this text.
  
  @return