Function: time-stamp--count-newlines

time-stamp--count-newlines is a byte-compiled function defined in time-stamp.el.gz.

Signature

(time-stamp--count-newlines STR)

Documentation

Return the number of newlines in STR.

Source Code

;; Defined in /usr/src/emacs/lisp/time-stamp.el.gz
(defun time-stamp--count-newlines (str)
  "Return the number of newlines in STR."
  (declare (pure t))
  (let ((nl-count 0)
        (nl-start 0))
    (while (setq nl-start (string-match-p "\n" str nl-start))
      (setq nl-count (1+ nl-count)
            nl-start (1+ nl-start)))
    nl-count))