- ;|==============================================;;
- ;;;[yj-str2lst]字符串分隔成字符串表(支持中文)-------------------------yjtdkj2020.02.04
- ;;; 函数: (yj-str2lst 字符串 分割符串)
- ;;===============================================;;
- |;
- (defun yj-str2lst (str divs / stri strn strlst)
- ;;;Integrated函数:判断字串str的前i个(从1开始计,与substr相同)字符是否完整。
- ;;;完整则返回T,否则返回nil。
- (defun yj-Integrated (str i / lst)
- (setq lst (vl-string->list (substr str 1 i))
- lst (vl-remove-if '(lambda (x) (< x 128)) lst)
- )
- (= 0 (rem (length lst) 2))
- )
- ;;;=============================
- (setq strn nil
- strlst nil
- )
- (while (and str (/= "" str))
- (if (yj-Integrated str 1)
- (setq stri (substr str 1 1))
- (setq stri (substr str 1 2))
- )
- (if (vl-string-search stri divs)
- (if strn
- (setq strlst (cons strn strlst)
- strn nil
- )
- )
- (setq strn (if strn
- (strcat strn stri)
- stri
- )
- )
- )
- (if (yj-Integrated str 1)
- (setq str (substr str 2))
- (setq str (substr str 3))
- )
- )
- (if strn
- (setq strlst (cons strn strlst)
- strn nil
- )
- )
- (if strlst
- (reverse strlst)
- nil
- )
- )
用这个函数,参数里面加空格就行了
|