How to check if a string is empty in Emacs Lisp?

Since in elisp, a String is an int array, you can use

(= (length user-str) 0)

You can also use (string=) which is usually easier to read

(string= "" user-str)

Equal works as well, but a bit slower:

(equal "" user-str)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)