 - (defun stradd (str i / n str1 str2 str3 str4)
- (setq n 0)
- (vl-some '(lambda (x / a)
- (if (< 47 x 58)
- t
- (setq n (1+ n)
- a nil
- )
- )
- )
- (VL-STRING->LIST str)
- )
- (setq str1 (substr str 1 n))
- (setq str2 (substr str (1+ n))
- n 0
- )
- (vl-some '(lambda (x / a)
- (if (or (< x 48) (> x 57))
- t
- (setq n (1+ n)
- a nil
- )
- )
- )
- (VL-STRING->LIST str2)
- )
- (setq str3 (substr str2 1 n))
- (setq str4 (substr str2 (1+ n)))
- (strcat str1 (itoa (+ i (atoi str3))) str4)
- )
- ;;测试
- ( stradd "第1张" 1)
- ==》
- "第2张"
|