Welcome to CADTutor.
Something like this?
(defun c:Test (/ str e ss n)
(if (and (setq str (getstring
t
"\nSpecify your text to overwrite selected texts : "
)
)
(/= str "")
(setq ss (ssget "_:L" '((0 . "*TEXT"))))
)
(repeat (setq n (sslength ss))
(entmod
(subst (cons 1 str)
(assoc 1 (setq e (entget (ssname ss (setq n (1- n))))))
e
)
)
)
)
(princ)
)
please be careful, LIST = 'space delimited'
"123 DF ABC" --> ("123" "DF" "ABC") ; 3 items in list
suggestion, underscore "_" or dash "-"
"123 DF_ABC" -> ("123" "DF_ABC") ; 2 items in list