Skip to main content
edited title
Link
Luke Girvin
  • 13.4k
  • 10
  • 65
  • 85

Check How to check if a string is empty in elispEmacs Lisp?

Source Link
oneself
  • 39.7k
  • 36
  • 99
  • 120

Check if a string is empty in elisp

I would like to write an if statement that will do something base on whether a string is empty. For example:

(defun prepend-dot-if-not-empty (user-str)
   (interactive "s")
   (if (is-empty user-str)
     (setq user-str (concat "." user-str)))
   (message user-str))

In this contrived example, I'm using (is-empty) in place of the real elisp method. What is the right way of doing this?

Thanks