(defun Midverse_A (s / c L i e o)
(setq L (strlen s) i (substr s 1 1) e (substr s L) s (substr s 2 (- L 2)) o "" c 1)
(repeat (strlen s)
(setq o (strcat (substr s c 1) o) c (1+ c))
)
(strcat i o e)
)
Better: (defun Midverse_A2 (s / c L i e)
(if (= 1 (setq L (strlen s)))
s
(progn
(setq i (substr s 1 1) e (substr s L) s (substr s 2 (- L 2)) c 1)
(repeat (strlen s)
(setq e (strcat (substr s c 1) e) c (1+ c))
)
(strcat i e)
)
)
)