Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  Built-in Functions /  Lists and Matrices /  Structure Manipulation /

Split

FilledSmallSquare Split[list] splits list into sublists consisting of runs of identical elements.
FilledSmallSquare Split[list, test] treats pairs of adjacent elements as identical whenever applying the function test to them yields True.

FilledSmallSquare Example: Split[a, a, b, b, a, a, b]LongRightArrow.
FilledSmallSquare The default function used to test whether elements are identical is SameQ.
FilledSmallSquare Split can be used to perform run-length encoding.
FilledSmallSquare See The Mathematica Book on the web: Section 1.8.10.
FilledSmallSquare See also: Partition, Union, Flatten, ReplaceList.