Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Functional Iteration >

TakeWhile

TakeWhile[list, crit]
gives elements ei from the beginning of list, continuing so long as crit[ei] is True.
Take elements while they are all even:
In[1]:=
Click for copyable input
Out[1]=
 
Use a pure function to take elements while they are all below 10:
In[1]:=
Click for copyable input
Out[1]=
New in 6
© 2013 Wolfram Research, Inc. Japanese
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team