Blank

or Blank[]
is a pattern object that can stand for any Mathematica expression.

or Blank[h]
can stand for any expression with head h.

DetailsDetails

  • The head h in cannot itself contain pattern objects.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

A pattern that matches any expression:

In[1]:=
Click for copyable input
Out[1]=

A pattern that matches any symbol:

In[2]:=
Click for copyable input
Out[2]=

A function definition that will take any single argument:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

A function definition for integer arguments only:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »