0 Members and 2 Guests are viewing this topic.
(defun AlphabetOnly ($ /) (while (and (wcmatch (substr $ 1 1) "@") $) (setq $ (substr $ 2)) ) (= $ ""))
; _$ (StrNump "abcdefg") -> nil; _$ (StrNump "abcdef8g") -> T(defun StrNump ( s ) (if (/= s "") (or (wcmatch (substr s 1 1) "#") (StrNump (substr s 2)) ) ))
(defun alpha-p ( s ) (wcmatch s "~*[~A-Za-z]*"))
Neither account for a string with a space or spaces
Where did the OP state the requirement to permit spaces?
i was merely pointing out that feeding in a string of only alphabet characters would return nil if there was a space
A space is not an alphabetic character.
Command: (defun alpha-p (s) (wcmatch s "~*[~A-Za-z],[ ]*"))ALPHA-PCommand: (alpha-p "test")TCommand: (alpha-p "123")nilCommand: (alpha-p "this is a big long string")TCommand: (alpha-p "this is a big long string with numbers 123")nil