Function or operator to test list membership

01192016, 03:28 PM
(This post was last modified: 01192016 03:33 PM by sbergman27.)
Post: #1




Function or operator to test list membership
I'm looking for a quick way to check to see if an integer is an element of a list. Maybe I'm just searching for the wrong terms in the Prime User Guide. But I haven't found a fast way to do it. Is "intersect" my best bet?


01192016, 03:41 PM
(This post was last modified: 01192016 03:41 PM by Didier Lachieze.)
Post: #2




RE: Function or operator to test list membership
You can use:
POS(list, element) Returns the position of an element within a list. A value of 0 is returned if there is no occurrence of the specified element. Example: POS ({3,7,12,19},12) returns 3 

01222016, 04:13 AM
Post: #3




RE: Function or operator to test list membership
Thank you.


« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)