Split

Split[list]

splits list into sublists consisting of runs of identical elements.

Split[list,test]

treats pairs of adjacent elements as identical whenever applying the function test to them yields True.

Details

  • The default function used to test whether elements are identical is SameQ.
  • Split can be used to perform runlength encoding. »

Examples

open allclose all

Basic Examples  (1)

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

Generalizations & Extensions  (5)

Applications  (5)

Properties & Relations  (1)

Neat Examples  (2)

See Also

SplitBy  Partition  StringSplit  GroupBy  FindClusters  Union  Flatten  ReplaceList  Tally  BinLists  GapPenalty

Tutorials

Introduced in 1996
(3.0)