Function: string-blank-p

string-blank-p is a byte-compiled function defined in subr-x.el.gz.

Signature

(string-blank-p STRING)

Documentation

Check whether STRING is either empty or only whitespace.

The following characters count as whitespace here: space, tab, newline and carriage return.

Other relevant functions are documented in the string group.

Probably introduced at or before Emacs version 24.4.

Shortdoc

;; string
(string-blank-p " \n")
    => 0

Aliases

rng-blank-p (obsolete since 29.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/subr-x.el.gz
;;;###autoload
(defsubst string-blank-p (string)
  "Check whether STRING is either empty or only whitespace.
The following characters count as whitespace here: space, tab, newline and
carriage return."
  (declare (pure t) (side-effect-free t))
  (string-match-p "\\`[ \t\n\r]*\\'" string))