I keep this one in my utils.lisp
:
(defun empty-string-p (string)
"Return true if the stringSTRING is empty or nil. Expects string type."
(or (null string)
(zerop (length (string-trim string)))))
then I do:
(not (empty-string-p some-string))
Emacs users: As of Emacs 26.3, trim
throws Symbol's function definition is void
. This page suggests functions starting in Emacs 24.4. The function is then:
(require 'subr-x)
(defun empty-string-p (string)
"Return true if the string is empty or nil. Expects string."
(or (null string)
(zerop (length (trim-string string)))))