明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 471|回复: 1

[经验] 字符串问题

[复制链接]
发表于 2022-6-24 14: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))
(princ  c1 )(princ  c2 )
(setq c4 (strcat  c1 "-" c2))
(princ c4)
发表于 2022-6-24 19:54 | 显示全部楼层
都不是字符串肯定报错啊
(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)))
(princ  c1 )
(terpri)
(princ  c2 )
(terpri)
(setq c4 (strcat  c1 "-" c2))
(princ c4)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-3 23:20 , Processed in 0.332406 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表