Jump to content

Recommended Posts

Posted

hi all, i need a function to find duplicate value or text in a list.

can someone help me??

 

thanks in advance. ;)

Posted

Maybe something as simple as this:

(defun foo (item lst) (vl-remove-if-not '(lambda (x) (equal item x)) lst))
;; (foo "1" '("1" "2" "3" "1" "1" "5" "1.0"))

Posted

Ron,

_$ (foo "1" '("1" "2" "3" "1" "1" "5" "1.0"))
("1" "1" "1")

 

If he ment 'duplicate value' then "1.0" should be returned aswell, I think.

The OP should provide a sample list... and what he expects to be returned.

Posted

Agreed .. just a quick example, not full blown solution. My guess is the OP probably want's a fuzz value too for numbers that should be 'equal'.

Posted

Thank you all guys, i used lee mac function that rlx introduced.

Posted
Thank you all guys, i used lee mac function that rlx introduced.

 

Glad it helped! Thanks for the recommendation rlx :thumbsup:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...