王咣生发表于2004-3-16 17:26:00回复:(王咣生)将输入的数据转换为字符串列表将输入的数据转换为字符串列表,如:;Example: (string->list \"Hello World\") = (\"Hello\" \"World\")(defun string->list (f_string / 这也算精简?nonono- ;(str2lst str) 将输入的数据转换为字符串列表.-----------------------------梁雄啸.2004.3
- ;测试: (str2lst "Hello 2World 12 5456.1568") = ("Hello" "2World" "12" "5456.1568")
- ;版权所有,盗用必究!如在程序中引用,请保留文字信息行.
- (defun str2lst (str / i)
- (while (setq i (vl-string-search " " str (if i (+ 2 i) 0)))
- (setq str (vl-string-subst """" " " str i))
- )(read (strcat "("" str "")"))
- )
|