This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Lists and Matrices / Structure Manipulation /

Further Examples: Flatten

Here is a list.

In[1]:=

This flattens out all the levels.

In[2]:=

Out[2]=

This flattens out sublists down to the second level.

In[3]:=

Out[3]=

This flattens only the first level of sublists.

In[4]:=

Out[4]=

This removes nested occurrences of the function h down to the second level.

In[5]:=

Out[5]=

You can use Flatten to splice sequences of elements into lists.

In[6]:=

Out[6]=

In[7]:=