Hello everyone.
I want to filter a list of strings just like the filter function in VB script ,but when I launch the code, the original list shows up.
Can anyone tell me what i'm doing wrong . Here is my code:
(vl-load-com)
(defun c:Filter (/ lst1 elem elem2)
(setq lst1 '("Study" "moon" "teacher" "ball"))
(foreach elem lst1
(setq elem2 (vl-string->list elem))
(if (= (member '(ascii "m") elem2) nil)
(vl-remove elem lst1)
(princ "\n")
)
)
(princ lst1)
(princ)
)
When I fire up the filter command ,I expect to get ("Study" "teacher" "ball") which is a list without strings that contain "m" letter in their structure.