Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Test if an element is contained in a list
ResourceFunction["ElementQ"][elem,list] gives True if the value elem is present in list. | |
ResourceFunction["ElementQ"][list] is the operator form of ResourceFunction["ElementQ"]. |
Basic usage:
In[1]:= | ![]() |
Out[1]= | ![]() |
Operator form:
In[2]:= | ![]() |
Out[2]= | ![]() |
Test strings:
In[3]:= | ![]() |
Out[3]= | ![]() |
Test algebraic expressions:
In[4]:= | ![]() |
Out[4]= | ![]() |
Head can be any other than List:
In[5]:= | ![]() |
Out[5]= | ![]() |
ElementQ tests only elements at level 1:
In[7]:= | ![]() |
Out[7]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License