On Sat, Nov 13, 2021 at 09:46:10AM +0300, Jean Louis wrote: > * Emanuel Berg via Users list for the GNU Emacs text editor [2021-11-13 00:21]: > > tomas wrote: > > > > > Why not simply numberp? > > > > > > (and (numberp s) (string-to-number s)) > > > > King :) > > (let ((s " 123")) > (and (numberp s) (string-to-number s))) ⇒ nil So leading spaces are to be ignored, OK. What about trailing spaces? Exponential notation? Bases other than 10? I think it's time you specify what a number is /for you/. Then compare that with what a number is /for numberp/. Then rewrite your program :) > Example is here: > > (let ((s " 123n")) > (string-to-number "123n")) ⇒ 123 Ah, but (numberp "123n") -> nil, so the and above would work. Or, perhaps, "123n" should be a number? This is unclear from what you say. At least to me. Cheers - t