;文字增减前缀[mini_zjqz].lsp
(defun c:mini_zjqz ( / old_cmd e ee st n ss)
	(mai_start nil)
	(mai_last_com "mini_zjqz")
	(setq ss (mai_select_first
				'((0 . "*TEXT"))
				"选择要增减前缀的单行文本:<退出>"
				"没有找到单行文本."
			)
	)
	(setq st (getstring "\n输入要给文本增加的前缀:<回车输入删除前缀的字符数>"))
	(or (not (mai_not_str st))
		(setq n (getint "\n输入要删除前缀的字符数:<回车退出>"))
		(exit)
	)
	(foreach e (mai_ssget_2_list SS)
		(setq
			ee (entget e)
			txt (mai_dxf 1 ee)
			txt (if n (substr txt n) (strcat st txt))
		)
		(if n
			(progn
				(setq txt (mai_str2lst txt ""))
				(repeat n (setq txt (cdr txt)))
				(if txt (setq txt (apply 'strcat txt)))
			)
			(setq txt (strcat st txt))
		)
		(if (mai_not_str txt)
			(entdel ee)
			(entmod (subst (cons 1 txt) (assoc 1 ee) ee))
		)
	)
	(mai_end)
)

