流_星 发表于 2022-6-24 14:41:41

字符串问题

大家帮忙看看,那有问题,老是报错

(setq a "AB123456-11-7")
(setq a (vl-string-translate "-" " " a) )
(setq a (strcat "(" a ")" ) )
(setq b (read a))
;(princ b)
(setq c1 (nth 0 b))
(setq        c2 (nth 1 b))
(princc1 )(princc2 )
(setq c4 (strcatc1 "-" c2))
(princ c4)

烟盒迷唇 发表于 2022-6-24 19:54:41

都不是字符串肯定报错啊
(setq a "AB123456-11-7" a (vl-string-translate "-" " " a)a (strcat "(" a ")" )b (read a))
;(princ b)
(setq c1 (vl-princ-to-string (nth 0 b)) c2 (vl-princ-to-string (nth 1 b)))
(princc1 )
(terpri)
(princc2 )
(terpri)
(setq c4 (strcatc1 "-" c2))
(princ c4)
页: [1]
查看完整版本: 字符串问题